fasttext可在ubuntu终端中使用,但不能在jupyter笔记本中使用

时间:2019-03-21 08:37:50

标签: python-3.x jupyter-notebook fasttext

从Ubuntu终端执行->

b @ PC:〜/ fastText $ ./fasttext监督-input /traningText.txt-输出model_trained -label label 读2M字 字数:78155 标签数:116 进度:100.0%字/秒/线程:296977 lr:0.000000丢失:1.616176 ETA:0h 0m

从jupyter笔记本执行-> 尝试1(切换到fastText文件夹后)

./ fasttext监督-input traningText.txt -output model_trained -label label

给出错误-

文件“”,第1行     ./fasttext监督-input traningText.txt -output model_trained -label 标签     ^ SyntaxError:语法无效

尝试2(切换到fastText文件夹后)

受监督的快速文本-输入trainingText-输出模型_trained-标签标签

给出错误-

文件“”,第1行     有监督的快速文本-input trainingText.txt-输出model_trained -label label                       ^ SyntaxError:语法无效

尝试3(切换到fastText文件夹后)

/ home / fastText / fasttext监督-input trainingText.txt-输出model_trained -label label

给出错误-

NameError跟踪(最近一次通话)  在 ----> 1个home / fastText / fasttext(有监督,-input,trainingText.txt,-output,model_trained,-label,标签

NameError:未定义名称“家”

出了什么问题?如何从Jupyter Notebook中执行我的fasttext命令以执行?请告知

1 个答案:

答案 0 :(得分:0)

您无法从Jupyter执行Shell命令并无法获得正确的输出。

如果要使用Jupyter的FastText,我的建议是安装FastText python绑定(https://github.com/facebookresearch/fastText/tree/master/python)。

这里有一个教程:https://idevji.com/tutorial-text-classification-with-python-using-fasttext/。 在这里,您可以找到一些示例:https://github.com/facebookresearch/fastText/tree/master/python/doc/examples