Spaces:
Sleeping
Sleeping
Commit
·
95a3d33
1
Parent(s):
cbd29d1
Update app.py
Browse files
app.py
CHANGED
@@ -4,4 +4,27 @@ def top3_text_classes(message, history):
|
|
4 |
|
5 |
demo_sentiment = gr.ChatInterface(top3_text_classes, title="Text Sentiment Chatbot", description="Enter your text, and the chatbot will classify the sentiment.")
|
6 |
|
7 |
-
demo_sentiment.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
demo_sentiment = gr.ChatInterface(top3_text_classes, title="Text Sentiment Chatbot", description="Enter your text, and the chatbot will classify the sentiment.")
|
6 |
|
7 |
+
demo_sentiment.launch()
|
8 |
+
|
9 |
+
|
10 |
+
def summarizer_bot(message, history):
|
11 |
+
return summarizer(message, min_length=5, max_length=140)[0]['summary_text']
|
12 |
+
|
13 |
+
demo_summarizer = gr.ChatInterface(summarizer_bot, title="Summarizer Chatbot", description="Enter your text, and the chatbot will return the summarized version.")
|
14 |
+
|
15 |
+
demo_summarizer.launch()
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
message_list = []
|
20 |
+
response_list = []
|
21 |
+
|
22 |
+
def vanilla_chatbot(message, history):
|
23 |
+
conversation = Conversation(text=message, past_user_inputs=message_list, generated_responses=response_list)
|
24 |
+
conversation = chatbot(conversation)
|
25 |
+
|
26 |
+
return conversation.generated_responses[-1]
|
27 |
+
|
28 |
+
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Vanilla Chatbot", description="Enter text to start chatting.")
|
29 |
+
|
30 |
+
demo_chatbot.launch()
|