Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
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 = [
|