thak123 commited on
Commit
2cdf71f
1 Parent(s): c43c096

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -7,7 +7,7 @@ os.environ["WANDB_DISABLED"] = "true"
7
  from datasets import load_dataset, load_metric
8
  from transformers import (
9
  AutoConfig,
10
- AutoModelForSequenceClassification,
11
  AutoTokenizer,
12
  TrainingArguments,
13
  logging,
@@ -32,15 +32,15 @@ pipeline
32
 
33
 
34
  # Question answering pipeline, specifying the checkpoint identifier
35
- model = AutoModelForSequenceClassification.from_pretrained(
36
- pretrained_model_name_or_path= "thak123/Cro-Frida",
37
- num_labels=3,
38
- )
39
 
40
 
41
  analyzer = pipeline(
42
 
43
- "sentiment-analysis", model=model, tokenizer="EMBEDDIA/crosloengual-bert"
44
 
45
  )
46
  def predict_sentiment(x):
@@ -54,7 +54,7 @@ interface = gr.Interface(
54
  fn=predict_sentiment,
55
  inputs='text',
56
  outputs=['label'],
57
- title='Latvian Twitter Sentiment Analysis',
58
  examples= ["Es mīlu Tevi","Es ienīstu kafiju"],
59
  description='Get the positive/neutral/negative sentiment for the given input.'
60
  )
 
7
  from datasets import load_dataset, load_metric
8
  from transformers import (
9
  AutoConfig,
10
+ # AutoModelForSequenceClassification,
11
  AutoTokenizer,
12
  TrainingArguments,
13
  logging,
 
32
 
33
 
34
  # Question answering pipeline, specifying the checkpoint identifier
35
+ # model = AutoModelForSequenceClassification.from_pretrained(
36
+ # pretrained_model_name_or_path= "thak123/Cro-Frida",
37
+ # num_labels=3,
38
+ # )
39
 
40
 
41
  analyzer = pipeline(
42
 
43
+ "sentiment-analysis", model="thak123/Cro-Frida", tokenizer="EMBEDDIA/crosloengual-bert"
44
 
45
  )
46
  def predict_sentiment(x):
 
54
  fn=predict_sentiment,
55
  inputs='text',
56
  outputs=['label'],
57
+ title='Croatian Movie reviews Sentiment Analysis',
58
  examples= ["Es mīlu Tevi","Es ienīstu kafiju"],
59
  description='Get the positive/neutral/negative sentiment for the given input.'
60
  )