Update README.md
Browse files
README.md
CHANGED
@@ -32,13 +32,13 @@ def tag(text: str):
|
|
32 |
text = text.strip().replace('\n', '')
|
33 |
tokenized_text = tokenizer.encode(text, return_tensors="pt")
|
34 |
|
35 |
-
|
36 |
num_beams=4,
|
37 |
no_repeat_ngram_size=2,
|
38 |
max_length=20,
|
39 |
early_stopping=True)
|
40 |
|
41 |
-
output = tokenizer.decode(
|
42 |
return output.split(',')
|
43 |
|
44 |
tags = tag(article)
|
|
|
32 |
text = text.strip().replace('\n', '')
|
33 |
tokenized_text = tokenizer.encode(text, return_tensors="pt")
|
34 |
|
35 |
+
tags_ids = model.generate(tokenized_text,
|
36 |
num_beams=4,
|
37 |
no_repeat_ngram_size=2,
|
38 |
max_length=20,
|
39 |
early_stopping=True)
|
40 |
|
41 |
+
output = tokenizer.decode(tags_ids[0], skip_special_tokens=True)
|
42 |
return output.split(',')
|
43 |
|
44 |
tags = tag(article)
|