用于使用ipywidgets的命名实体识别(NER)的空间注释器。
spacy-annotator的Python项目详细描述
空间注释器
用于使用ipywidgets的命名实体识别(NER)的空间注释器。 注释器允许用户快速为文本中的一个或多个实体指定自定义标签。在
功能:
- 注释器支持pandas dataframe(请参见
pandas_annotations.py
):它在dataframe的单独“annotation”列中添加注释 - 如果空间模型传递给注释器,则该模型用于标识文本中的实体。
这种预先标记的技巧-使用当前最佳模型的例子允许加速标记-也称为噪声预标记 - 注释遵循spaCy格式,可以作为spaCy-NER模型的输入。
不需要额外的代码!在
Note:不使用pandas dataframe?没问题。您总是可以从存储在简单python列表中的文本中标记实体(请参见list_annotations.py
)。在
博文:medium/enrico.alemani/spacy-annotator
示例代码-pandas注释
importpandasaspdimportrefromspacy_annotator.pandas_annotationsimportannotateaspd_annotate# Datadf=pd.DataFrame.from_dict({'full_text':['New York is lovely but Milan is amazing!']})# Annotationspd_dd=pd_annotate(df,col_text='full_text',# Column in pandas dataframe containing text to be labelledlabels=['GPE','PERSON'],# List of labelssample_size=1,# Size of the sample to be labelleddelimiter='~',# Delimiter to separate entities in GUImodel=None,# spaCy model for noisy pre-labellingregex_flags=re.IGNORECASE# One (or more) regex flags to be applied when searching for entities in text)# Example outputpd_dd['annotations'][0]
预览
贡献
- 在GitHub上进行回购
- 将项目克隆到您自己的机器上
- 将更改提交给您自己的分支机构;以及
- 把你的工作推到你自己的岔子上
- 提交拉取请求以便我可以查看您的更改。在
版本
ipywidgets:7.5.1
回复:2.2.1
间距:2.2.4
参考文献
空间注释器基于spaCy和pigeon。
非常感谢他们公开了他们令人敬畏的图书馆。在
- 项目
标签: