[英]Where does class Transformers come from?
All show the use of this import全部显示使用这个导入
from sklearn.pipeline import Pipeline, FeatureUnion
from Transformers import TextTransformer
When I run it当我运行它
ModuleNotFoundError Traceback (most recent call last) <ipython-input-6-1f277e1659bb> in <module>() 1 from sklearn.pipeline import Pipeline, FeatureUnion ----> 2 from Transformers import TextTransformer ModuleNotFoundError: No module named 'Transformers
Googling only led me to the links I've already posted.谷歌搜索只会让我找到我已经发布的链接。
Where does Transformers
come from? Transformers
从何而来?
import sklearn
import sys
print(sklearn.__version__)
print(sys.version)
0.18.1
3.6.0 |Anaconda 4.3.1 (x86_64)| (default, Dec 23 2016, 13:19:00)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
What about关于什么
pip install transformers
The error message ModuleNotFoundError: No module named 'Transformers
is because transformers is not installed most likely.错误消息
ModuleNotFoundError: No module named 'Transformers
是因为最有可能没有安装转换器。
从您提供的第二个链接来看,它似乎是一个名为Transformers.py
的用户定义文件,其中包含类TextTransformer
。
Yes, I am pretty sure it is some custom file containing transformers, which are very likely inheriting from TransformerMixin
( http://scikit-learn.org/stable/modules/generated/sklearn.base.TransformerMixin.html ).是的,我很确定它是一些包含变压器的自定义文件,它们很可能继承自
TransformerMixin
( http://scikit-learn.org/stable/modules/generated/sklearn.base.TransformerMixin.html )。
This allows, as shown in the linked questions, to include custom data transformations in a pipeline.如链接的问题所示,这允许在管道中包含自定义数据转换。 For an intro I recommend this great blog post, where also custom transformers are shown: http://zacstewart.com/2014/08/05/pipelines-of-featureunions-of-pipelines.html
对于介绍,我推荐这篇很棒的博客文章,其中还显示了自定义转换器:http: //zacstewart.com/2014/08/05/pipelines-of-featureunions-of-pipelines.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.