Skip to content

Commit

Permalink
remove problematic dependency pattern (#34 #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
blmoistawinde committed Apr 14, 2021
1 parent 01a3ae5 commit bcf039c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion harvesttext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .harvesttext import HarvestText
from .resources import *

__version__ = '0.8.1.1'
__version__ = '0.8.1.2'

def saveHT(htModel,filename):
with open(filename, "wb") as f:
Expand Down
7 changes: 5 additions & 2 deletions harvesttext/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def get_summary(self, sents, topK=5, stopwords=None, with_importance=False, stan
# 使用standard_name,相似度可以基于实体链接的结果计算而更加准确
sent_tokens = [self.seg(sent.strip(), standard_name=standard_name, stopwords=stopwords) for sent in sents]
if self.language == "en":
from pattern.en import lemma
sent_tokens = [[lemma(wd) for wd in sent] for sent in sent_tokens]
try:
from pattern.en import lemma
sent_tokens = [[lemma(wd) for wd in sent] for sent in sent_tokens]
except:
print(" `pattern` is not installed, so the english words will not be lemmatized, this might slightly hurt the summary quality")
sent_tokens = [sent for sent in sent_tokens if len(sent) > 0]
G = nx.Graph()
for u, v in combinations(range(len(sent_tokens)), 2):
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ python-louvain
tqdm
w3lib
nltk
opencc-python-reimplemented
pattern
opencc-python-reimplemented

0 comments on commit bcf039c

Please sign in to comment.