sgonzalezsilot
commited on
Commit
•
b60c78b
1
Parent(s):
28c1d26
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import from_pretrained_keras
|
3 |
-
import
|
|
|
|
|
4 |
m = from_pretrained_keras('sgonzalezsilot/FakeNews-Detection-Twitter-Thesis')
|
5 |
|
6 |
def bert_encode(tokenizer,data,maximum_length) :
|
@@ -28,7 +30,7 @@ train_encodings = tokenizer(train_texts, truncation=True, padding=True)
|
|
28 |
test_encodings = tokenizer(test_texts, truncation=True, padding=True)
|
29 |
|
30 |
MODEL = "digitalepidemiologylab/covid-twitter-bert-v2"
|
31 |
-
tokenizer
|
32 |
|
33 |
sentence_length = 110
|
34 |
train_input_ids,train_attention_masks = bert_encode(tokenizer,train_texts,sentence_length)
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import from_pretrained_keras
|
3 |
+
from transformers import AutoTokenizer
|
4 |
+
|
5 |
+
|
6 |
m = from_pretrained_keras('sgonzalezsilot/FakeNews-Detection-Twitter-Thesis')
|
7 |
|
8 |
def bert_encode(tokenizer,data,maximum_length) :
|
|
|
30 |
test_encodings = tokenizer(test_texts, truncation=True, padding=True)
|
31 |
|
32 |
MODEL = "digitalepidemiologylab/covid-twitter-bert-v2"
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL)
|
34 |
|
35 |
sentence_length = 110
|
36 |
train_input_ids,train_attention_masks = bert_encode(tokenizer,train_texts,sentence_length)
|