bootphon / wordseg

A Python toolbox for text based word segmentation
https://docs.cognitive-ml.fr/wordseg
GNU General Public License v3.0
16 stars 7 forks source link

wordseg-stats #8

Closed cainesap closed 7 years ago

cainesap commented 7 years ago

Hello, We encountered a problem with wordseg-stats. Running "wordseg-stats corpus.txt" results in the following error message: File "/Library/Frameworks/Python.framework/Versions/3.6/bin/wordseg-stats", line 11, in load_entry_point('wordseg==0.4.1', 'console_scripts', 'wordseg-stats')() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 565, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 2631, in load_entry_point return ep.load() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 2291, in load return self.resolve() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pkg_resources/init.py", line 2297, in resolve module = import(self.module_name, fromlist=['name'], level=0) ModuleNotFoundError: No module named 'wordseg.stats'

Please could you advise what to do? many thanks, Andrew

mmmaat commented 7 years ago

Hi Andrew, thanks for reporting.

This was a typo in the setup.py... stats instead of statistics. Just pull the last commit and rerun the installation process it should work!

Mathieu

cainesap commented 7 years ago

Thank you Mathieu! Yes that's better. But now there's a new error message: 2 top frequency tokens: Hello 1 world 1 Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/bin/wordseg-stats", line 11, in load_entry_point('wordseg==0.4.1', 'console_scripts', 'wordseg-stats')() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wordseg-0.4.1-py3.6.egg/wordseg/utils.py", line 68, in call File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wordseg-0.4.1-py3.6.egg/wordseg/statistics.py", line 106, in main """_sum(data [, start]) -> (type, sum, count) TypeError: write() argument must be str, not DataFrame

mmmaat commented 7 years ago

Ok thanks, it should be fixed now. Sorry but the stats module is quite poor for now, and not yet tested. Let us now if you want other stats to be computed...