fix: term weight issue (#3294)

### What problem does this PR solve?



### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2024-11-08 15:49:44 +08:00
committed by GitHub
parent 5205bdab24
commit 8b6e272197
2 changed files with 35 additions and 6 deletions

View File

@ -227,7 +227,7 @@ class Dealer:
idf2 = np.array([idf(df(t), 1000000000) for t in tks])
wts = (0.3 * idf1 + 0.7 * idf2) * \
np.array([ner(t) * postag(t) for t in tks])
tw = zip(tks, wts)
tw = list(zip(tks, wts))
else:
for tk in tks:
tt = self.tokenMerge(self.pretoken(tk, True))