Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ from cijiang.utils import print_results
|
|
5 |
rhymer = CiJiangRhymer(strict=False, tone=True)
|
6 |
|
7 |
def get_results(input_text, target_rhyme, beam_width, num_candidates, top_results):
|
8 |
-
out = rhymer.get_rhymes(
|
9 |
-
mask_count =
|
10 |
-
context =
|
11 |
|
12 |
all_outputs = f"======= 韵脚: |{target_rhyme}|\n"
|
13 |
for i, (seq, log_prob) in enumerate(out[:top_results]):
|
|
|
5 |
rhymer = CiJiangRhymer(strict=False, tone=True)
|
6 |
|
7 |
def get_results(input_text, target_rhyme, beam_width, num_candidates, top_results):
|
8 |
+
out = rhymer.get_rhymes(text_with_placeholder=input_text, target_rhyme=target_rhyme, beam_width=beam_width, num_candidates=num_candidates)
|
9 |
+
mask_count = input_text.count("[M]")
|
10 |
+
context = input_text.split('[M]')[0]
|
11 |
|
12 |
all_outputs = f"======= 韵脚: |{target_rhyme}|\n"
|
13 |
for i, (seq, log_prob) in enumerate(out[:top_results]):
|