python文本结构化处理

Labelled data has been a crucial demand for supervised machine learning leading to a new industry altogether. This is an expensive and time-consuming activity with an unstructured text data which requires custom made techniques/rules to assign appropriate labels.

标记数据一直是对有监督的机器学习的一项至关重要的需求,从而带动了整个新兴产业的发展。 对于非结构化文本数据,这是一项昂贵且费时的活动,需要定制技术/规则来分配适当的标签。

With the advent of state-of-the-art ML models and framework pipelines like Tensorflow and Pytorch, the dependency of data science practitioners has increased upon them for multiple problems. But these can only be consumed if provided with well-labelled training datasets and the cost and quality of this activity are positively correlated with Subject matter experts (SME). These constraints have directed the minds of practitioners towards Weak Supervision — an alternative of labelling training data utilizing high — level supervision from SMEs and some abstraction from noisier inputs using task-specific heuristics and regular expression patterns. These techniques have been employed in some opensource labelling models like Snorkel using Labelling functions and paid proprietaries Groudtruth, Dataturks etc.

随着最先进的ML模型和Tensorflow和Pytorch之类的框架管道的出现,数据科学从业者对多种问题的依赖日益增加。 但是,只有在提供了标签明确的培训数据集之后,这些内容才能被消耗,并且这项活动的成本和质量与主题专家(SME)呈正相关。 这些限制使从业者的思想转向“弱监督”(Weak Supervision),这是一种利用中小型企业的高层监督来标记培训数据的方法,并且使用特定于任务的试探法和正则表达式模式从嘈杂的输入中进行抽象。 这些技术已被某些开源标签模型采用,例如使用标签功能的Snorkel以及付费所有者Groudtruth,Dataturks等。

The solution proposed is for a Multinational Enterprise Information Technology client that develops a wide variety of hardware components as well as software-related services for consumers & businesses. They deploy a robust Service team that supports customers through after-sales services. The client recognized the need for an in-depth, automated, and near-real-time analysis of customer communication logs. This has several benefits such as enabling proactive identification of product shortcomings and pinpointing improvements in future product releases.

提出的解决方案是针对跨国企业信息技术客户的,该客户为消费者和企业开发了各种各样的硬件组件以及与软件相关的服务。 他们部署了一支强大的服务团队,通过售后服务为客户提供支持。 客户认识到需要对客户通信日志进行深入,自动化和近乎实时的分析。 这具有许多好处,例如能够主动发现产品缺陷并在将来的产品版本中指出改进之处。

We developed a two-phase solution strategy to address the problem at hand.

我们制定了两阶段解决方案策略来解决当前的问题。

The first task was that of a binary classification to segregate customer calls into Operating System (OS) and Non-Operating System (Non-OS) calls. Since labelled data was not available in this case, we resorted to using Regular Expressions for this classification exercise. Using Regex also has the added utility of labelling the data in their respective categories. In the second phase, we targeted the ‘Non-OS’ category to tag other features.

第一项任务是二进制分类的任务,目的是将客户呼叫分为操作系统(OS)和非操作系统(Non-OS)呼叫。 由于在这种情况下无法使用标签数据,因此我们使用正则表达式进行分类。 使用Regex还具有在其各自类别中标记数据的附加实用程序。 在第二阶段,我们以“非操作系统”类别为目标来标记其他功能。

A Stepwise Solution Approach is thus:

因此,逐步解决方案是:

Preprocessing:

预处理

1. Create a corpus of frequently used OS phrases and abbreviations (ex: windows install, windows activation, Deployment issue, windows, VMware)

1.创建一个常用操作系统短语和缩写的语料库(例如:Windows安装,Windows激活,部署问题,Windows,VMware)

2. Similarly, form a corpus of phrases and words that may occur simultaneously with the OS phrases and may indicate to non-OS calls.

2.类似地,形成短语和单词的语料库,这些短语和单词可能与OS短语同时出现,并可能指示非OS调用。

Core steps:

核心步骤:

1. Standard text cleaning procedures such as:

1.标准的文字清洁程序,例如:

a) Convert text to all lower cases

a)将文本转换为所有小写

b) Remove multiple spaces

b)删除多个空格

c) Remove punctuations and special characters

c)删除标点符号和特殊字符

d) Remove non-ASCII characters

d)删除非ASCII字符

2. In the first search pass, identify OS related words and phrases to tag the relevant calls as OS calls

2.在第一遍搜索中,识别与操作系统相关的词和短语,以将相关呼叫标记为操作系统呼叫

3. In the second search pass, identify non-OS related words and phrases to tag calls related to features other than operating systems. This is needed as most call logs will keep a record of the configuration of the system which may lead to false tagging of the calls as OS

3.在第二遍搜索中,标识与操作系统无关的单词和短语,以标记与操作系统以外的功能相关的调用。 这是必需的,因为大多数呼叫日志将保留系统配置的记录,这可能导致错误地将呼叫标记为OS

Details for the phrase and word search:

短语和单词搜索的详细信息:

a) Create a dictionary of all text with the text of each row split into words and save the list of words as an element of the dictionary against the text or unique id.

a)创建所有文本的字典,将每一行的文本分成单词,并将单词列表作为文本或唯一ID的字典元素保存。

b) Now split each phrase of the corpus in words and search for each word of the phrase in each element of the dictionary. If all the words of the phrase are available in a given element of the dictionary, then tag the respective text or unique id accordingly.

b)现在将语料库的每个短语拆分为单词,然后在字典的每个元素中搜索短语的每个单词。 如果该短语的所有单词在字典的给定元素中均可用,则相应地标记相应的文本或唯一ID。

c) Similarly, search for the words in the corpus in all the text and tag the successful search calls accordingly.

c)同样,在所有文本中搜索语料库中的单词,并相应地标记成功的搜索调用。

Code Snippets

代码段

Text cleaning:

文字清理:

Phrase search:

词组搜索:

Limitations

局限性

1. Currently, the text is being only searched for the phrases of a single product and having it tagged accordingly. As an improvement, we can expect to include phrases of multiple products and tag the calls in a similar fashion.

1.目前,仅在文本中搜索单个产品的短语并对其进行相应标记。 作为改进,我们可以期望包含多个产品的短语,并以类似的方式标记通话。

2. We can also include the language translations for foreign languages and check for spelling mistakes.

2.我们还可以包括外语的语言翻译,并检查拼写错误。

3. Domain experts can help in creating an exclusive set of words and phrases for each product which can make the product more customizable for different industry segments.

3.领域专家可以帮助为每个产品创建一组专有的单词和短语,这可以使产品针对不同的行业细分而更加可定制。

Sample search results

样本搜索结果

1. OS Terms: RHEL, RedHat, OS install, no boot, subscription

1. 操作系统条款: RHEL,RedHat,操作系统安装,不启动,订阅

2. Non-OS Terms: HW (Hardware), Disk Error

2. 非操作系统术语:硬件(硬件),磁盘错误

Proposed Future Enhancements

拟议的未来增强功能

1. The labelled training data can be consumed into training an NLP based Binary classification model which can classify the call logs into OS and Non-OS classes.

1.标记的训练数据可以用于训练基于NLP的二进制分类模型,该模型可以将呼叫日志分类为OS和Non-OS类。

2. Textual data needs to be converted into vectorized form, which can be achieved by using word embeddings for each token in the sentence. We can use pre-trained open-source embeddings like FastText, BERT, GloVe, etc.

2.文本数据需要转换为矢量化形式,这可以通过对句子中的每个标记使用单词嵌入来实现。 我们可以使用经过预先训练的开源嵌入,例如FastText,BERT,GloVe等。

3. Some of the state-of-the-art models, like Neural Nets, can be used for the classification task, with RNN/GRU/LSTM layers to learn representations for text sequences.

3.一些最新的模型,例如神经网络,可以用于分类任务,通过RNN / GRU / LSTM层可以学习文本序列的表示形式。

翻译自: https://towardsdatascience.com/labelling-unstructured-text-data-in-python-974e809b98d9

python文本结构化处理

http://www.taodudu.cc/news/show-863600.html

相关文章:

  • 图像分类数据库_图像分类器-使用僧侣库对房屋房间类型进行分类
  • 利用PyCaret的力量
  • ai伪造论文实验数据_5篇有关AI培训数据的基本论文
  • 机器学习经典算法实践_服务机器学习算法的系统设计-不同环境下管道的最佳实践
  • css餐厅_餐厅的评分预测
  • 机器学习结构化学习模型_生产化机器学习模型
  • 人工智能已经迫在眉睫_创意计算机已经迫在眉睫
  • 合奏:机器学习中唯一(几乎)免费的午餐
  • 在Ubuntu 18.04上安装和使用Tesseract 4
  • pytorch机器学习_机器学习— PyTorch
  • 检测和语义分割_分割和对象检测-第1部分
  • ai人工智能编程_从人工智能动态编程:Q学习
  • 架构垂直伸缩和水平伸缩区别_简单的可伸缩图神经网络
  • yolo opencv_如何使用Yolo,SORT和Opencv跟踪足球运动员。
  • 人工智能的搭便车指南
  • 机器学习 对回归的评估_在机器学习回归问题中应使用哪种评估指标?
  • 可持久化数据结构加扫描线_结构化光扫描
  • 信号处理深度学习机器学习_机器学习和信号处理如何融合?
  • python 数组合并排重_并排深度学习:Julia vs Python
  • 强化学习 求解迷宫问题_使用天真强化学习的迷宫求解器
  • 朴素贝叶斯 半朴素贝叶斯_使用朴素贝叶斯和N-Gram的Twitter情绪分析
  • 自动填充数据新增测试数据_用测试数据填充员工数据库
  • bart使用方法_使用简单变压器的BART释义
  • 卷积网络和卷积神经网络_卷积神经网络的眼病识别
  • 了解回归:迈向机器学习的第一步
  • yolo yolov2_PP-YOLO超越YOLOv4 —对象检测的进步
  • 机器学习初学者_绝对初学者的机器学习
  • monk js_对象检测-使用Monk AI进行文档布局分析
  • 线性回归 c语言实现_C ++中的线性回归实现
  • 忍者必须死3 玩什么忍者_降维:忍者新手

python文本结构化处理_在Python中标记非结构化文本数据相关推荐

  1. 简述python语言的主要领域_简述Python语言经验总结

    Python语言是不被大多数人知道的东西,这里就简单概述下Python语言,顺便闲谈一 下Python 标准库."俗话"说:库即是语言,语言即是库.由此可见拥有一套高质量.具备良好 ...

  2. python 结构体数组_关于python:将结构化数组转换为常规NumPy数组

    我认为答案将非常明显,但目前看不到. 如何将记录数组转换回常规ndarray? 假设我有以下简单的结构化数组: x = np.array([(1.0, 4.0,), (2.0, -1.0)], dty ...

  3. python分支结构的关键字_学习python分支结构

    学习python分支结构 来源:中文源码网    浏览: 次    日期:2019年11月5日 [下载文档:  学习python分支结构.txt ] (友情提示:右键点上行txt文档名->目标另 ...

  4. python交互式和文件式_使用Python创建和自动化交互式仪表盘

    python交互式和文件式 In this tutorial, I will be creating an automated, interactive dashboard of Texas COVI ...

  5. python做审计底稿视频_最新Python教学视频,每天自学俩小时,让你offer拿到手软...

    2020最新Python零基础到精通资料教材,干货分享,新基础Python教材,看这里,这里有你想要的所有资源哦,最强笔记,教你怎么入门提升!让你对自己更加有信心,重点是资料都是免费的,免费!!! 如 ...

  6. python十大必备知识_学Python必备的基础知识

    学Python必备的基础知识 1.基本概念 表达式:就是一个类似于数学公式的东西,一般仅仅用了计算一些结果 ,不会对程序产生实质性的影响,如9+3; 语句:在程序中语句一般需要完成某种功能,比如打印信 ...

  7. 学python的有哪些好书_学习python有哪些好书和学习方法?

    不请自来~ 上干货 <Python数据分析>作者: [印尼]Ivan Idris Python是一种多范型编程语言,既适用于面向对象的应用开发,又适合函数式设计模式.Python已经成为数 ...

  8. python cookbook 中文百度云_《Python+Cookbook》第三版中文v3.0.0PDF高清完整版免费下载|百度云盘...

    David Beazley是一位居住在芝加哥的独立软件开发者以及图书作者.他主要的工作在于编程工具,提供定制化的软件开发服务,以及为软件开发者.科学家和工程师教授编程实践课程.他最为人熟知的工作在于P ...

  9. python判断题题库_《Python程序设计》判断题1-240题

    1.Python是一种跨平台.开源.免费的高级动态编程语言.(对) 2.Python 3.x完全兼容Python 2.x.(错) 3.Python 3.x和Python 2.x唯一的区别就是:prin ...

最新文章

  1. abaqus linux 下载64位,SIMULIA ABAQUS 2016.0 Win64 Linux64 2DVD工程模拟的有限元
  2. HTML的br/标签和hr/标签
  3. 自动 更新SVN目录文件.bat
  4. 奇妙的安全旅行之RSA算法
  5. 问八股文的公司都是垃圾!?
  6. 阿里云成为MariaDB基金会白金会员 全球唯一入选云计算公司
  7. RIA 应用程序模式
  8. 《Java并发编程实践》笔记1——并发编程基础
  9. 在线预览打印Word文档
  10. 总结一下__declspec(dllimport)的作用
  11. 【EXLIBRIS】纸版书目整理 -- 增补至2008年春节【36 种】【36 册】
  12. c语言 交互式电子白板案例,交互式电子白板案例分析
  13. AE关键帧动画基础概念
  14. telnet控制路由器交换机与微信公众平台
  15. 数据可视化总结——matplotlib、seaborn
  16. 靶场练习第二天~vulnhub靶场之 THE PLANETS: EARTH
  17. 程序员转正述职报告_程序员转正的述职报告【五篇】
  18. ZeroBrane Studio远程调试Cocos2d-x的Lua脚本
  19. python首页展示业务逻辑_01-商品查询业务逻辑的实现
  20. 2018年刑侦科推理试题php版,2018年刑侦科目推理试题完整版分享

热门文章

  1. .NET环境下每日集成(4):CruiseControl.Net配置注意事项
  2. Spark Streaming揭秘 Day16 数据清理机制
  3. 【J2ME 2D 游戏开发系列】◣HIMI游戏开发启蒙教程◢JAVA零基础学习J2ME游戏开发全过程!...
  4. 最佳实践:如何基于MNS和OSS实现无大小限制的消息传输
  5. lightoj 1224
  6. 10个调试Java的技巧
  7. 纪年法:公元和公元前
  8. 制作点击文字变颜色_腾讯的动态时间轴PPT火了!制作简单又有逼格,都学起来啊...
  9. 360怎么看电脑配置_电脑速度慢怎么办?教你电脑速度慢的原因与解决方法
  10. tomcat 、jsp、 servlet 、jstl版本对应