751ff35eb5faa6460038bb20a1ef6bfcf29f440a,jieba/analyse/__init__.py,,extract_tags,#Any#Any#Any#,62
Before Change
for w in words:
if len(w.strip()) < 2:
continue
if w.lower() in STOP_WORDS:
continue
freq[w] = freq.get(w, 0.0) + 1.0
total = sum(freq.values())
freq = [(k,v/total) for k,v in freq.iteritems()]
After Change
freq[k] *= idf_freq.get(k, median_idf) / total
if withWeight:
tags = sorted(freq.items(), key=itemgetter(1), reverse=True)
else:
tags = sorted(freq, key=freq.__getitem__, reverse=True)
if topK:
return tags[:topK]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: fxsjy/jieba
Commit Name: 751ff35eb5faa6460038bb20a1ef6bfcf29f440a
Time: 2014-10-31
Author: abcdoyle888@gmail.com
File Name: jieba/analyse/__init__.py
Class Name:
Method Name: extract_tags
Project Name: shibing624/pycorrector
Commit Name: dad1abdcffb4d37256502a73a1c236aa2f07636b
Time: 2020-03-17
Author: xuming624@qq.com
File Name: pycorrector/bert/bert_corrector.py
Class Name: BertCorrector
Method Name: bert_correct
Project Name: apache/incubator-mxnet
Commit Name: e2cbf6605e1a6f15777099f56821b42159605335
Time: 2020-08-12
Author: lausen@amazon.com
File Name: python/mxnet/gluon/trainer.py
Class Name: Trainer
Method Name: __init__