Update app.py
Browse files
app.py
CHANGED
@@ -57,9 +57,9 @@ def get_response(input_text):
|
|
57 |
try:
|
58 |
adequacy_filtered = adequacy_score.filter(input_text,tgt_text, adequacy_threshold, device)
|
59 |
if len(adequacy_filtered) > 0 :
|
60 |
-
|
61 |
if len(fluency_filtered) > 0 :
|
62 |
-
|
63 |
return get_max_str(diversity_scored)
|
64 |
else:
|
65 |
return get_max_str(fluency_filtered)
|
@@ -81,7 +81,7 @@ def get_fun(Input_txt):
|
|
81 |
txt_paraphrase=txt_paraphrase+' '+tmp
|
82 |
return txt_paraphrase
|
83 |
|
84 |
-
iface = gr.Interface(fn=get_fun, inputs="text", outputs="
|
85 |
iface.launch(inline=False)
|
86 |
|
87 |
"""# New Section"""
|
|
|
57 |
try:
|
58 |
adequacy_filtered = adequacy_score.filter(input_text,tgt_text, adequacy_threshold, device)
|
59 |
if len(adequacy_filtered) > 0 :
|
60 |
+
fluency_filtered = fluency_score.filter(adequacy_filtered, fluency_threshold, device )
|
61 |
if len(fluency_filtered) > 0 :
|
62 |
+
diversity_scored = diversity_score.rank(input_text, fluency_filtered, diversity_ranker)
|
63 |
return get_max_str(diversity_scored)
|
64 |
else:
|
65 |
return get_max_str(fluency_filtered)
|
|
|
81 |
txt_paraphrase=txt_paraphrase+' '+tmp
|
82 |
return txt_paraphrase
|
83 |
|
84 |
+
iface = gr.Interface(fn=get_fun, inputs="text", outputs=gr.Textbox(label="Output", lines=5)"text" , title = " Ai Re-Phraser Q'Hackday")
|
85 |
iface.launch(inline=False)
|
86 |
|
87 |
"""# New Section"""
|