smoothnlp / SmoothNLP

专注于可解释的NLP技术 An NLP Toolset With A Focus on Explainable Inference
GNU General Public License v3.0
624 stars 112 forks source link

新词发现可以用来发现长词组吗?比如:生物医药板块、新冠疫苗板块 #56

Open zsp042 opened 4 years ago

zsp042 commented 4 years ago

新词发现可以用来发现长词组吗?比如:生物医药板块、新冠疫苗板块

ZXR-v2 commented 4 years ago

同问!

victorzhrn commented 4 years ago
def extract_phrase(corpus,
                   top_k: float = 200,
                   chunk_size: int = 1000000,
                   min_n:int = 2,
                   max_n:int=4,
                   min_freq:int = 5):

源码中, 其实有两个参数 max_nmax_n分别是抽取出词汇的最短与最长字符长度. issue里提到的case: 生物医药板块,新冠疫苗板块 字符长度为5; 如果明确是要找5字短语, 可以试试直接设置min_n=5,max_n=5