Emanuela Boros
commited on
Commit
·
aa884ba
1
Parent(s):
4a05f16
Add nltk
Browse files- README.md +1 -1
- app.py +6 -0
- requirements.txt +2 -1
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: News Agency Recognition
|
3 |
emoji: 💻
|
4 |
colorFrom: pink
|
5 |
colorTo: green
|
|
|
1 |
---
|
2 |
+
title: News Agency Recognition in French
|
3 |
emoji: 💻
|
4 |
colorFrom: pink
|
5 |
colorTo: green
|
app.py
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
token = os.getenv("HF_TOKEN")
|
6 |
get_completion = pipeline(
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import os
|
4 |
+
import nltk
|
5 |
+
|
6 |
+
# Check if the resource is available; if not, download it
|
7 |
+
nltk.download("averaged_perceptron_tagger")
|
8 |
+
|
9 |
+
# Your existing app code follows
|
10 |
|
11 |
token = os.getenv("HF_TOKEN")
|
12 |
get_completion = pipeline(
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
transformers[torch]
|
2 |
gradio
|
3 |
-
nltk
|
|
|
|
1 |
transformers[torch]
|
2 |
gradio
|
3 |
+
nltk
|
4 |
+
numpy
|