Reputation: 1
I am trying to train my classifier system using fasttext supervised classifier as follows:
My txt file head head is :
__label__0A001 0a001 “nuclear reactors” and specially designed or prepared equipment and components therefor, as follows: a. “nuclear reactors”; b. metal vessels, or major shopfabricated parts therefor, including the reactor vessel head for a reactor pressure vessel, specially designed or prepared to contapin the core of a “nuclear reactor”;
__label__0B001 0b001 plant for the separation of isotopes of “natural uranium”, “depleted uranium” and “special fissile materials”, and specially designed or prepared equipment and components therefor, other than analytical instruments, as follows: a. plant specially designed for separating isotopes of “natural uranium”, “depleted uranium”, and “special fissile materials”
import fasttext
model = fasttext.train_supervised(input='myfile.txt')
However, I get this error:
Traceback (most recent call last):
File "C:/Users/u5712005/PycharmProjects/recognize_dsgl_risky_research/Risky_researcher_DSGL/recognize_dsgl_risky_research/fasttext_main.py", line 53, in <module>
model = fasttext.train_supervised(input=path.lookuptable_keyphrases_fasttext)
File "C:\Users\u5712005\Anaconda3\lib\site-packages\fasttext\FastText.py", line 529, in train_supervised
a = _build_args(args, manually_set_args)
File "C:\Users\u5712005\Anaconda3\lib\site-packages\fasttext\FastText.py", line 421, in _build_args
setattr(a, k, v)
TypeError: (): incompatible function arguments. The following argument types are supported:
1. (self: fasttext_pybind.args, arg0: str) -> None
Invoked with: <fasttext_pybind.args object at 0x0000020F3B47EEF0>, WindowsPath('C:/Users/u5712005/PycharmProjects/recognize_dsgl_risky_research/Risky_researcher_DSGL/data/Output_data/DSG_lookup_fasttext_table.txt')
Any suggestion?
Masi
Upvotes: 0
Views: 1184
Reputation: 54153
It looks like you're using a Windows OS. The main Facebook FastText page says:
Generally, fastText builds on modern Mac OS and Linux distributions.
The page for its official Python wrapper says:
fastText builds on modern Mac OS and Linux distributions. Since it uses C++11 features, it requires a compiler with good C++11 support. You will need Python (version 2.7 or ≥ 3.4), NumPy & SciPy and pybind11.
I don't see any mention of Windows support on those pages, so it's possible the core package hasn't been designed or tested to work out-of-the-box on Windows.
Looking through the project's Github issues, there are a number of open and closed issues related to trying to run it on Windows. Some make mention of success, via extra steps or possibly by using unofficial wheels from other sources.
If you need to use Windows, you may have luck searching those issues.
If you don't need to use Windows, much of the Python data science stack is better-tested & supported on MacOS or Linux.
Upvotes: 1