Spaces:
Running
Running
miesnerjacob
commited on
Commit
Β·
67caa78
1
Parent(s):
801e201
installed en_core_web_sm independently from spacy
Browse files- keyword_extraction.py +2 -1
- requirements.txt +1 -0
keyword_extraction.py
CHANGED
@@ -2,11 +2,12 @@ import spacy
|
|
2 |
import pytextrank
|
3 |
import re
|
4 |
from operator import itemgetter
|
|
|
5 |
|
6 |
|
7 |
class KeywordExtractor:
|
8 |
def __init__(self):
|
9 |
-
self.nlp =
|
10 |
self.nlp.add_pipe("textrank")
|
11 |
|
12 |
def get_keywords(self, text, max_keywords):
|
|
|
2 |
import pytextrank
|
3 |
import re
|
4 |
from operator import itemgetter
|
5 |
+
import en_core_web_sm
|
6 |
|
7 |
|
8 |
class KeywordExtractor:
|
9 |
def __init__(self):
|
10 |
+
self.nlp = en_core_web_sm.load()
|
11 |
self.nlp.add_pipe("textrank")
|
12 |
|
13 |
def get_keywords(self, text, max_keywords):
|
requirements.txt
CHANGED
@@ -14,3 +14,4 @@ transformers-interpret~=0.7.2
|
|
14 |
htbuilder==0.6.0
|
15 |
pytextrank
|
16 |
spacy
|
|
|
|
14 |
htbuilder==0.6.0
|
15 |
pytextrank
|
16 |
spacy
|
17 |
+
en-core-web-sm
|