fukufuk
commited on
Commit
•
59947d3
1
Parent(s):
318adba
Update application file
Browse files- app.py +2 -3
- lib/fact_summarizer.py +1 -1
app.py
CHANGED
@@ -51,6 +51,7 @@ def main(url):
|
|
51 |
|
52 |
if len(opinions) == 0:
|
53 |
opinion_reason_text = "<h3>この文章には意見に関する文が見つかりませんでした。</h3>"
|
|
|
54 |
else:
|
55 |
opinion_reasons = opinion_reason_classifer(client, opinions)
|
56 |
all_opinion_data_html_format = "<ul>{all_data}</ul>"
|
@@ -65,8 +66,6 @@ def main(url):
|
|
65 |
data_texts = get_data_info(client, facts)
|
66 |
predicted_data = get_raw_data_info(client, data_texts)
|
67 |
data_main_message, raw_data_html_txt = get_raw_data_html(sentence_text, data_texts, predicted_data)
|
68 |
-
|
69 |
-
opinion_reason_text = f"""<div style="padding: 10px; overflow-x: scroll; border: 1px #999999 solid; height: 450px;"> {opinion_reason_text}</div>"""
|
70 |
return fact_main_message, opinion_main_message, opinion_reason_html, fact_sentence, raw_data_html_txt, data_main_message
|
71 |
|
72 |
|
@@ -99,7 +98,7 @@ if __name__ == "__main__":
|
|
99 |
<h2 id="title_">情報リテラシーサポートツール</h2>
|
100 |
''')
|
101 |
gr.Markdown('### ※意見文の抽出精度は <u>93.3%</u> です。誤っている可能性には十分注意してください。')
|
102 |
-
inp = gr.Textbox(label='',placeholder="こちらに記事のURLをコピペしてください。")
|
103 |
|
104 |
btn = gr.Button("Enter")
|
105 |
with gr.Row():
|
|
|
51 |
|
52 |
if len(opinions) == 0:
|
53 |
opinion_reason_text = "<h3>この文章には意見に関する文が見つかりませんでした。</h3>"
|
54 |
+
opinion_reason_html = f"""<div style="padding: 10px; overflow-x: scroll; border: 1px #999999 solid; height: 450px;"> {opinion_reason_text}</div>"""
|
55 |
else:
|
56 |
opinion_reasons = opinion_reason_classifer(client, opinions)
|
57 |
all_opinion_data_html_format = "<ul>{all_data}</ul>"
|
|
|
66 |
data_texts = get_data_info(client, facts)
|
67 |
predicted_data = get_raw_data_info(client, data_texts)
|
68 |
data_main_message, raw_data_html_txt = get_raw_data_html(sentence_text, data_texts, predicted_data)
|
|
|
|
|
69 |
return fact_main_message, opinion_main_message, opinion_reason_html, fact_sentence, raw_data_html_txt, data_main_message
|
70 |
|
71 |
|
|
|
98 |
<h2 id="title_">情報リテラシーサポートツール</h2>
|
99 |
''')
|
100 |
gr.Markdown('### ※意見文の抽出精度は <u>93.3%</u> です。誤っている可能性には十分注意してください。')
|
101 |
+
inp = gr.Textbox(label='', placeholder="こちらに記事のURLをコピペしてください。")
|
102 |
|
103 |
btn = gr.Button("Enter")
|
104 |
with gr.Row():
|
lib/fact_summarizer.py
CHANGED
@@ -21,4 +21,4 @@ def fact_summarizer(client: OpenAI, sentence: str, model_name='gpt-4o-mini-2024-
|
|
21 |
temperature=0
|
22 |
)
|
23 |
|
24 |
-
return response.choices[0].message.content
|
|
|
21 |
temperature=0
|
22 |
)
|
23 |
|
24 |
+
return response.choices[0].message.content
|