SmoothNLP
SmoothNLP copied to clipboard
新词发现可以用来发现长词组吗?比如:生物医药板块、新冠疫苗板块
新词发现可以用来发现长词组吗?比如:生物医药板块、新冠疫苗板块
同问!
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_n
与max_n
分别是抽取出词汇的最短与最长字符长度. issue里提到的case: 生物医药板块
,新冠疫苗板块
字符长度为5; 如果明确是要找5字短语, 可以试试直接设置min_n=5
,max_n=5