KAHRAMAN42 commited on
Commit
12c089b
·
1 Parent(s): 4f3f769

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -1,18 +1,12 @@
1
- import gradio as gr
2
- from textblob import TextBlob
3
 
4
- def sentiment_analysis(text):
5
- analysis = TextBlob(text)
6
- sentiment = analysis.sentiment
7
 
8
- if sentiment.polarity > 0:
9
- sentiment_label = "Positive"
10
- elif sentiment.polarity < 0:
11
- sentiment_label = "Negative"
12
- else:
13
- sentiment_label = "Neutral"
14
 
15
- return f"Metin Duygusu: {sentiment_label}"
16
 
17
- iface = gr.Interface(fn=sentiment_analysis, inputs="text", outputs="text")
18
- iface.launch()
 
1
+ message_list = []
2
+ response_list = []
3
 
4
+ def vanilla_chatbot(message, history):
5
+ conversation = Conversation(text=message, past_user_inputs=message_list, generated_responses=response_list)
6
+ conversation = chatbot(conversation)
7
 
8
+ return conversation.generated_responses[-1]
 
 
 
 
 
9
 
10
+ demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Vanilla Chatbot", description="Enter text to start chatting.")
11
 
12
+ demo_chatbot.launch()