THULAC-Python
THULAC-Python copied to clipboard
An Efficient Lexical Analyzer for Chinese
很多print语句都是直接写死在代码里的,这样如果多进程并行处理又没有加锁很容易出现抢占打印设备的问题,至少应该在API里给一个print_info=False这样的参数,或者直接写进log文件
thu1 = thulac.thulac(seg_only=True) 还是 thu1 = thulac.thulac(seg_only=['是的']) 我不太清楚 如何使用的
thulac中的trie是用单个数组来实现的,我在看源代码的时候非常困扰,网上又很难找到相关的资料,但是我又好奇thulac中的trie到底是怎样实现的,能不能给一个文档读一读呢。
比如用numpy。一个ngram的特征是向量,动态规划`dbDecode()` (话说应该是`dpDecode()`吧)使用向量和矩阵运算,把3层python for循环降为1层。
请问fast_cut调用的so版本使用的model是可开放下载(不用特别审批)的那个50多mb的model吗?
D:\Python35-32>python -m thulac inputu.txt output.txt seg_only Model loaded succeed Traceback (most recent call last): File "D:\Python35-32\lib\runpy.py", line 184, in _run_module_as_main "__main__", mod_spec) File "D:\Python35-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals)...
是直接通过空格分割吗?`filt=True`时有的英文和数字也会被过滤,想问下具体的机制是怎样的,工作中遇到了中英数字夹杂的文本。
Python 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import thulac >>> thu...
D:\ProgramData\Anaconda3\envs\pyppeteer\python.exe F:/Pywork/pyppe/agent_pyq/test_thulac.py F:\Pywork\pyppe\agent_pyq Traceback (most recent call last): File "F:/Pywork/pyppe/agent_pyq/test_thulac.py", line 47, in thu1 = ThulacSo() # 模型等文件预读取和初始化 File "F:/Pywork/pyppe/agent_pyq/test_thulac.py", line 23, in __init__ self.lib = cdll.LoadLibrary('F:/Pywork/pyppe/agent_pyq/libthulac.so') # 读取so文件 File...