Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,7 +68,6 @@ class Chatbot:
|
|
| 68 |
|
| 69 |
def load_data(self, path: str = DATA_PATH):
|
| 70 |
self.df = pd.read_excel(path, sheet_name='Default')
|
| 71 |
-
self.test_df = pd.read_excel(path, sheet_name='Test')
|
| 72 |
self.df['Context'] = pd.read_excel(path, sheet_name='mdeberta')['Context']
|
| 73 |
|
| 74 |
def load_model(self, model_name: str = DEFAULT_MODEL):
|
|
@@ -174,13 +173,7 @@ if __name__ == "__main__":
|
|
| 174 |
highlighted_answer = highlight_text(response["answer"], response["highlight_start"], response["highlight_end"])
|
| 175 |
return highlighted_answer
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
demo = gr.ChatInterface(
|
| 180 |
-
fn=chat_interface,
|
| 181 |
-
examples=bot._chatbot.test_df,
|
| 182 |
-
title="CE66-04: Thai Question Answering System by using Deep Learning",
|
| 183 |
-
description=description
|
| 184 |
-
)
|
| 185 |
-
|
| 186 |
demo.launch()
|
|
|
|
| 68 |
|
| 69 |
def load_data(self, path: str = DATA_PATH):
|
| 70 |
self.df = pd.read_excel(path, sheet_name='Default')
|
|
|
|
| 71 |
self.df['Context'] = pd.read_excel(path, sheet_name='mdeberta')['Context']
|
| 72 |
|
| 73 |
def load_model(self, model_name: str = DEFAULT_MODEL):
|
|
|
|
| 173 |
highlighted_answer = highlight_text(response["answer"], response["highlight_start"], response["highlight_end"])
|
| 174 |
return highlighted_answer
|
| 175 |
|
| 176 |
+
EXAMPLE = ["หลิน ไห่เฟิง มีชื่อเรียกอีกชื่อว่าอะไร" , "ใครเป็นผู้ตั้งสภาเศรษฐกิจโลกขึ้นในปี พ.ศ. 2514 โดยทุกปีจะมีการประชุมที่ประเทศสวิตเซอร์แลนด์", "โปรดิวเซอร์ของอัลบั้มตลอดกาล ของวงคีรีบูนคือใคร", "สกุลเดิมของหม่อมครูนุ่ม นวรัตน ณ อยุธยา คืออะไร"]
|
| 177 |
+
|
| 178 |
+
demo = gr.ChatInterface(fn=chat_interface, examples=EXAMPLE, title="CE66-04: Thai Question Answering System by using Deep Learning")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
demo.launch()
|