at2507 commited on
Commit
9776416
·
1 Parent(s): e1bbb2f

add examples, additional description.

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -13,14 +13,13 @@ The LLM was finetuned on a Financial News Tweet Sentiment Dataset. The documents
13
  <img src="https://huggingface.co/spaces/course-demos/Rick_and_Morty_QA/resolve/main/rick.png" width=200px>
14
  """
15
 
16
- article = "Check out the dataset that [BERT cased]((https://huggingface.co/bert-base-cased?text=Paris+is+the+%5BMASK%5D+of+France.)) was [finetuned on](https://huggingface.co/datasets/zeroshot/twitter-financial-news-sentiment/viewer/zeroshot--twitter-financial-news-sentiment/train?row=9505)."
17
 
18
-
19
- def sentiment_analyzer(tweet):
20
  tokenizer = AutoTokenizer.from_pretrained("at2507/finetuned_model")
21
  model = AutoModelForSequenceClassification.from_pretrained("at2507/finetuned_model")
22
  zeroshotsent_model = pipeline("text-classification", model = model.to('cpu:0'), tokenizer=tokenizer)
23
- return zeroshotsent_model(tweet)
24
 
25
  gr.Interface(
26
  fn=sentiment_analyzer,
@@ -30,7 +29,9 @@ gr.Interface(
30
  description=description,
31
  article=article,
32
  examples=[["CLNE, TRXC, TGE and ADMS among midday movers"],
33
- ["CRISPR Therapeutics among healthcare gainers; Plus Therapeutics leads the losers"]],
 
 
34
  ).launch()
35
 
36
 
 
13
  <img src="https://huggingface.co/spaces/course-demos/Rick_and_Morty_QA/resolve/main/rick.png" width=200px>
14
  """
15
 
16
+ article = "Check out the model card [here](https://huggingface.co/at2507/finetuned_model)!"
17
 
18
+ def sentiment_analyzer(financial_news_headline):
 
19
  tokenizer = AutoTokenizer.from_pretrained("at2507/finetuned_model")
20
  model = AutoModelForSequenceClassification.from_pretrained("at2507/finetuned_model")
21
  zeroshotsent_model = pipeline("text-classification", model = model.to('cpu:0'), tokenizer=tokenizer)
22
+ return zeroshotsent_model(financial_news_headline)
23
 
24
  gr.Interface(
25
  fn=sentiment_analyzer,
 
29
  description=description,
30
  article=article,
31
  examples=[["CLNE, TRXC, TGE and ADMS among midday movers"],
32
+ ["CRISPR Therapeutics among healthcare gainers; Plus Therapeutics leads the losers"],
33
+ ["Firsthand Technology Value Fund and Itau CorpBanca among Financial gainers; Mmtec and Jupai among losers"],
34
+ ["Canopy Growth up 6% as BofA buys the dip"]],
35
  ).launch()
36
 
37