Hector Lopez commited on
Commit
e184c49
1 Parent(s): d0e0bba

Added description to gradio interface

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -24,12 +24,33 @@ def process_tweet(url: str) -> str:
24
  outcome = predict_positivity(text)
25
 
26
  return outcome
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
 
29
  app = gr.Interface(
30
  fn=process_tweet,
31
  inputs=gr.inputs.Textbox(lines=2, placeholder="Tweet url..."),
32
  outputs="text",
 
 
 
33
  )
34
 
35
  if __name__ == "__main__":
 
24
  outcome = predict_positivity(text)
25
 
26
  return outcome
27
+
28
+ title = "Twitter Positivity Analyzer"
29
+ description = """
30
+ <h2> Description </h2>
31
+ Twitter is a social media network on which users post and interact with messages known as "tweets". It allows an user to post, like, and retweet tweets.
32
+
33
+ Twitter is also known by the excessive negativity or criticism by a great part of its users. Considering that, this application intends to classify a tweet according to its positivity. The positivity is measured in five categories:
34
+ - Extremely negative
35
+ - Negative
36
+ - Neutral
37
+ - Positive
38
+ - Extremely positive
39
+
40
+ The application is based on a BERT model fine tuned on the [Coronavirus tweets NLP dataset](https://www.kaggle.com/datasets/datatattle/covid-19-nlp-text-classification).
41
+ """
42
+
43
+ article = "Check out this [github repository](https://colab.research.google.com/drive/14ce4KD6PrCIL60Eng-t79tEI1UP-DHGz?usp=sharing#scrollTo=Mg1tUeHLRLaG) \
44
+ with a lot more details about this method and implementation."
45
 
46
 
47
  app = gr.Interface(
48
  fn=process_tweet,
49
  inputs=gr.inputs.Textbox(lines=2, placeholder="Tweet url..."),
50
  outputs="text",
51
+ title=title,
52
+ description=description,
53
+ article=article,
54
  )
55
 
56
  if __name__ == "__main__":