Spark NLP可视化软件包

spark-nlp-displa的Python项目详细描述


火花nlp显示器

一个用于简单可视化不同类型的Spark NLP注释的库。在

支持的可视化:

  • 依赖关系分析器
  • 命名实体识别
  • 实体解析
  • 关系抽取
  • 断言状态

完成教程

Open In Colab

https://github.com/JohnSnowLabs/spark-nlp-display/blob/main/tutorials/Spark_NLP_Display.ipynb

要求

  • 火花nlp
  • 伊普顿
  • 斯维格瑞特
  • 熊猫
  • numpy公司

安装

pip install spark-nlp-display

如何使用

依赖关系分析器

^{pr2}$

命名实体识别

fromsparknlp_displayimportNerVisualizerner_vis=NerVisualizer()ner_vis.display(pipeline_result[0],#should be the results of a single example, not the complete dataframelabel_col='entities',#specify the entity columndocument_col='document'#specify the document column (default: 'document')labels=['PER']#only allow these labels to be displayed. (default: [] - all labels will be displayed))## To set custom label colors:ner_vis.set_label_colors({'LOC':'#800080','PER':'#77b5fe'})#set label colors by specifying hex codes

实体解析
fromsparknlp_displayimportEntityResolverVisualizerer_vis=EntityResolverVisualizer()er_vis.display(pipeline_result[0],#should be the results of a single example, not the complete dataframelabel_col='entities',#specify the ner result columnresolution_col='resolution'document_col='document'#specify the document column (default: 'document'))## To set custom label colors:er_vis.set_label_colors({'TREATMENT':'#800080','PROBLEM':'#77b5fe'})#set label colors by specifying hex codes

关系抽取

fromsparknlp_displayimportRelationExtractionVisualizerre_vis=RelationExtractionVisualizer()re_vis.display(pipeline_result[0],#should be the results of a single example, not the complete dataframerelation_col='relations',#specify relations columndocument_col='document',#specify document columnshow_relations=True#display relation names on arrows (default: True))

断言状态

fromsparknlp_displayimportAssertionVisualizerassertion_vis=AssertionVisualizer()assertion_vis.display(pipeline_result[0],label_col='entities',#specify the ner result columnassertion_col='assertion'#specify assertion columndocument_col='document'#specify the document column (default: 'document'))## To set custom label colors:assertion_vis.set_label_colors({'TREATMENT':'#008080','problem':'#800080'})#set label colors by specifying hex codes

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
交换数组中重复值的位置(Java)   java搜索使用百分比匹配Elasticsearch SpringBoot中的文本   java Spring JPA和按输入字段排序   java我在输入CSV时出错了   java如何在RecyclerView中精确显示5项   使用java安全吗。util。servlet中的计时器?   使用Cp1252编码的java比较字符串   javafx打包java桌面应用程序,并引用开源许可证   java Spring和Camel CXF在战争中表现出色   java当EJB客户端失去与应用服务器的连接时,是否存在可以捕获的异常?   更改字符串值的java注释   java如何在sharedperfernce中保存自定义数组列表   RequestResponseLink:当使用java客户端读取队列时,Azure服务总线上RequestResponseLink到“$cbs”的内部发送链接因错误而关闭