Update app.py
Browse files
app.py
CHANGED
|
@@ -185,12 +185,35 @@ app = gr.Interface(
|
|
| 185 |
outputs=["text", "number"],
|
| 186 |
)
|
| 187 |
#app.launch()
|
|
|
|
| 188 |
|
| 189 |
-
|
|
|
|
| 190 |
# create a public link, set `share=True` in `launch()
|
| 191 |
#app_sentiment.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
|
| 193 |
app_facts = gr.Interface(fn=factextraction , inputs="textbox", outputs="textbox", title="Conversation Bots")
|
| 194 |
# create a public link, set `share=True` in `launch()
|
| 195 |
-
app_facts.launch()
|
|
|
|
|
|
|
| 196 |
|
|
|
|
| 185 |
outputs=["text", "number"],
|
| 186 |
)
|
| 187 |
#app.launch()
|
| 188 |
+
####################
|
| 189 |
|
| 190 |
+
|
| 191 |
+
#app_sentiment = gr.Interface(fn=predict , inputs="textbox", outputs="textbox", title="Conversation Bot")
|
| 192 |
# create a public link, set `share=True` in `launch()
|
| 193 |
#app_sentiment.launch()
|
| 194 |
+
####################
|
| 195 |
+
|
| 196 |
+
###
|
| 197 |
+
###
|
| 198 |
+
###
|
| 199 |
+
classifier = pipeline("zero-shot-classification")
|
| 200 |
+
text = "This is a tutorial about Hugging Face."
|
| 201 |
+
candidate_labels = ["tech", "education", "business"]
|
| 202 |
+
|
| 203 |
+
def topic_sale_inform (text)
|
| 204 |
+
res = classifier(text, candidate_labels)
|
| 205 |
+
print (res)
|
| 206 |
+
return res
|
| 207 |
+
|
| 208 |
+
app_topic = gr.Interface(fn=topic_sale_inform , inputs="textbox", outputs="textbox", title="Conversation Bots")
|
| 209 |
+
# create a public link, set `share=True` in `launch()
|
| 210 |
+
app_topic.launch()
|
| 211 |
+
####################
|
| 212 |
+
|
| 213 |
|
| 214 |
app_facts = gr.Interface(fn=factextraction , inputs="textbox", outputs="textbox", title="Conversation Bots")
|
| 215 |
# create a public link, set `share=True` in `launch()
|
| 216 |
+
#app_facts.launch()
|
| 217 |
+
####################
|
| 218 |
+
|
| 219 |
|