clavel commited on
Commit
0f44ac3
1 Parent(s): 8013813

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
app.py CHANGED
@@ -57,19 +57,14 @@ classificationResult = pipe("El objetivo de esta tesis es elaborar un estudio de
57
 
58
 
59
  def thesis_prediction(input):
60
- tokenizer = AutoTokenizer.from_pretrained('"hiiamsid/BETO_es_binary_classification"', use_fast=False)
61
 
62
- model = AutoModelForSequenceClassification.from_pretrained(
63
- 'hackathon-pln-es/unam_tesis_BETO_finnetuning', num_labels=5, output_attentions=False,
64
- output_hidden_states=False)
65
-
66
- pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
67
- classificationResult = pipe(input)
68
- classificationResult[0].sort(reverse=True, key=lambda x:x['score'])
69
- keyClass = classificationResult[0][0]['label']
70
- # # Return the text clasification
71
- # keyClass = classificationResult[0][0]['label']
72
- return keyClass
73
 
74
 
75
  examples = [
 
57
 
58
 
59
  def thesis_prediction(input):
60
+ tokenizer = AutoTokenizer.from_pretrained('"hiiamsid/BETO_es_binary_classification"', use_fast=False)
61
 
62
+ model = AutoModelForSequenceClassification.from_pretrained('hackathon-pln-es/unam_tesis_BETO_finnetuning', num_labels=5, output_attentions=False, output_hidden_states=False)
63
+ pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
64
+ classificationResult = pipe(input)
65
+ classificationResult[0].sort(reverse=True, key=lambda x:x['score'])
66
+ keyClass = classificationResult[0][0]['label']
67
+ return keyClass
 
 
 
 
 
68
 
69
 
70
  examples = [