Spaces:
Build error
Build error
Commit ·
43f24b5
1
Parent(s): 00a84c6
mend spacy use
Browse files- app.py +4 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -17,7 +17,10 @@ spacy.cli.download("ru_core_news_sm")
|
|
| 17 |
|
| 18 |
class NewsProcessor:
|
| 19 |
def __init__(self, similarity_threshold=0.75, time_threshold=24):
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
self.embeddings = pipeline("feature-extraction",
|
| 22 |
model="sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
|
| 23 |
token=st.secrets["hf_token"])
|
|
|
|
| 17 |
|
| 18 |
class NewsProcessor:
|
| 19 |
def __init__(self, similarity_threshold=0.75, time_threshold=24):
|
| 20 |
+
try:
|
| 21 |
+
self.nlp = spacy.load("ru_core_news_sm")
|
| 22 |
+
except:
|
| 23 |
+
self.nlp = spacy.load("en_core_web_sm")
|
| 24 |
self.embeddings = pipeline("feature-extraction",
|
| 25 |
model="sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
|
| 26 |
token=st.secrets["hf_token"])
|
requirements.txt
CHANGED
|
@@ -5,4 +5,5 @@ transformers
|
|
| 5 |
rapidfuzz
|
| 6 |
openpyxl
|
| 7 |
tqdm
|
| 8 |
-
spacy
|
|
|
|
|
|
| 5 |
rapidfuzz
|
| 6 |
openpyxl
|
| 7 |
tqdm
|
| 8 |
+
spacy
|
| 9 |
+
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.0/en_core_web_sm-3.7.0.tar.gz
|