将非结构化文本的组提取到以后的NLP中?

问题描述 投票:0回答:1

我是数据挖掘/文本挖掘的新手,所以我不确定我使用的是正确的术语。我正在尝试提出一个提取相关内容组的过程,以便以后应用NLP和其他技术从中提取有意义的数据。我的起始数据看起来像这样:

Product Name - $-25- 15
Product Name - $3

Product Bundle $100
-Product 1
-Product 2 Condition
-Product 3 Condition

Product - Version - Condition $100

Product
Extras
Extras

More Info
$20 

Product
Extras
Condition
$15

Product (Condition) 50
Product (Condition) 25
Product (Condition) 10

目标是获得这样的列表,其中每个“列表”都有一个唯一的条目,并与相关的元数据分组:

[Product Name - $-25- 15], [Product Name - $3], [Product Bundle $100 -Product 1 -Product 2 Condition -Product 3 Condition], [Product - Version - Condition $100] 

全文由许多不同的作者撰写,并且经常在单个帖子中切换格式,因此我无法检测到它是哪种格式并无法处理整个文档。所有格式的共同点是它们具有新的换行符,而不是密集的文本段落。因此,与之合作,我对如何处理它有一些想法:

选项1:基本

  1. 通过新行(\ n)将文档分割成数组
  2. 如果条目之间有多余的空白,则将先前的条目分组
  3. 如果没有多余的空间,请检查是否有价格,如果有的话,请考虑将其视为自己的组

此选项非常简单,当双倍行距时可以使用。但是,如果使用数字作为启发式来确定它是否是一个新组,则失败,因为产品名称,附加信息和条件在单行间距时可能包含数字。

选项2:NLP

此选项将尝试将文档中的每个单词分类为产品名称,条件,属性和价格。然后再次处理文档以对文本进行分组,以使其具有名称和价格以及可选的条件和额外的元数据。

这种方法的问题在于,附加项和捆绑包也是产品,因此,由于它们在文档中的间隔方式,当它们属于“父”产品时,对其进行分类将确定它们是元数据的唯一条目。

选项3:还有其他东西吗?

我的第一个想法是先将文档分成几组,以便NLP知道该组中的所有单词都与同一产品相关。我有所有产品名称的清单和所有条件中的一个相当不错的清单。附加功能,版本和其他文字是唯一的,因此在尝试确定如何分组时可能会引起一些问题。

似乎可能需要将两者混合使用,因为作者如何分隔它们最终是如何将所有东西捆绑在一起的。但是我们不立即知道下一组内容是否与第一个或新列表相关,而无需其他任何处理。

INPUT

Mario Party - $10

Party Games Bundle $100
-Super Mario Bros
-Mario World - NEW

Donkey Kong - 2017 Version - Used $10

Wii Sports
Includes Controllers

Also includes memory card
$10 

Grand Theft Auto
San Andreas
Includes poster
Used
$10

Zelda (Unopened box) 10

输出(JSON)

{ listings: [
    { name: 'Mario Party', condition: null, version: null, currency: '$', price: 10, includes: null },
    { name: 'Party Games Bundle', condition: null, version: null, currency: '$', price: 100, includes: ['Super Mario Bros', 'Mario World - NEW'] },
    { name: 'Donkey Kong', condition: 'Used', version: '2017 Version', currency: '$', price: 10, includes: null },
    { name: 'Wii Sports', condition: null, version: null, currency: '$', price: 10, includes: ['Includes Controllers', 'Also includes memory card'] },
    { name: 'Grand Theft Auto', condition: 'Used', version: 'San Andreas', currency: '$', price: 10, includes: 'Includes poster' },
    { name: 'Zelda', condition: 'Unopened box', version: null, currency: '$', price: 10, includes: null }
] }
nlp data-mining text-mining information-retrieval information-extraction
1个回答
0
投票

如果愿意在一段时间内训练模型并提高准确性,则文章here将对此有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.