遇见数据集

Teddy487/WikiAssertions

收藏
Hugging Face2024-05-30 更新2024-06-12 收录
官方服务:

资源简介:

--- dataset_info: features: - name: articleId dtype: int64 - name: lineId dtype: int64 - name: factId dtype: int64 - name: text dtype: string - name: subj dtype: string - name: pred dtype: string - name: auxi sequence: string - name: prep1 dtype: string - name: obj1 dtype: string - name: prep2 dtype: string - name: obj2 dtype: string - name: prep3 dtype: string - name: obj3 dtype: string - name: prep4 dtype: string - name: obj4 dtype: string - name: prep5 dtype: string - name: obj5 dtype: string splits: - name: train num_bytes: 86532750060 num_examples: 439305160 download_size: 31248975339 dataset_size: 86532750060 configs: - config_name: default data_files: - split: train path: data/train-* --- # WikiAssertions: A Dataset of Assertions from Wikipedia WikiAssertions contains all the Assertions (a.k.a. Atomic Facts) in Wikipedia. It was created by running a [strong multi-valent open IE system](https://github.com/Teddy-Li/MulVOIEL/) on the sentencized [Wikipedia](https://huggingface.co/datasets/wikipedia) corpus. The same exact model checkpoint that we used to parse the corpus can be downloaded at [Teddy487/LLaMA3-8b-for-OpenIE](https://huggingface.co/Teddy487/LLaMA3-8b-for-OpenIE). Assertions are multi-valent relation tuples representing factoid information at the atomic level. For example, given the following sentence: `Earlier this year , President Bush made a final `` take - it - or - leave it '' offer on the minimum wage` The following assertion can be extracted: <<span style="color:#2471A3">President Bush</span>, <span style="color:#A93226">made</span>, <span style="color:#138D75">a final "take-it-or-leave-it" offer</span>, <span style="color:#B7950B ">on the minimum wage</span>, <span style="color:#B9770E">earlier this year</span>> We introduce the data format below, and refer users to our [Github Repository](https://github.com/Teddy-Li/MulVOIEL/) and our Model Cards ([Teddy487/LLaMA2-7b-for-OpenIE](https://huggingface.co/Teddy487/LLaMA2-7b-for-OpenIE), [**Teddy487/LLaMA3-8b-for-OpenIE**](https://huggingface.co/Teddy487/LLaMA3-8b-for-OpenIE)) for more information. ## Data Format Each entry in this dataset is an assertion in Wikipedia. An assertion is a multi-valent relation tuple of the format: `<subj> ,, (<auxi> ###) <predicate> ,, (<prep1> ###) <obj1>, (<prep2> ###) <obj2>, ...` An assertion includes a subject, a predicate (essentially verbs), an optional auxiliary (negation / modal verb / etc.), and a number of objects (0, 1, 2, etc.). Each object may come with an optional preposition (e.g. on, with, for, etc.). The dataset follows the format laid out as belows: ### MetaData Columns: 1. articleId: the ID of the document as in the id column in the [Wikipedia](https://huggingface.co/datasets/wikipedia) corpus. 2. lineId: the sentence ID within a document as sentencized using the [spaCy sentencizer](https://spacy.io/api/sentencizer). 3. factId: the assertion ID within the sentence. ### Content Columns: 1. text: the assertion presented in the form of natural language text. 2. subj: subject of the assertion. 3. pred: predicate (main verb) of the assertion. 4. (optional) auxi: auxiliary element of the assertion (negation, model verbs, etc.) 5. (optional) prep1: preposition for object 1 (can be empty); 6. (optional) obj1: object 1 (typically the direct object for transitive verbs, could be empty for intranitive verbs). 7. (optional) prep2: preposition for object 2 (can be empty); 8. (optional) obj2: object 2 10. (optional) prep3: preposition for object 3 (can be empty); 11. (optional) obj3: object 3 12. (optional) prep4:preposition for object 4 (can be empty); 13. (optional) obj4: object 4 14. (optional) prep5:preposition for object 5 (can be empty); 15. (optional) obj5: object 5 Note that we keep a maximum number of 5 object slots per assertion. When an assertion involves more arguments, the overflowing arguments are ignored. When the predicate is a [light verb](https://en.wikipedia.org/wiki/Light_verb), the light verb itself does not bear sufficient meaning to disambiguate the eventualities. Therefore, in that case, we merge the first object (`obj1`) into the `pred` field. We only do this when the first object does not come with a preposition (i.e. `prep1` is empty); otherwise, we treat it as an anomaly and disgard that assertion. ## Mapping with the original text in Wikipedia The original text for each assertion in the dataset can be found from the [Wikipedia](https://huggingface.co/datasets/wikipedia) corpus in Huggingface. We use the `20220301.en` version of Wikipedia, which can be loaded using the following python command: ```python from datasets import load_dataset wiki_corpus = load_dataset("wikipedia", "20220301.en", split='train') ``` The `articleId` field in the dataset corresponds to the document `id` in the loaded dataset. If you wish to locate the exact sentence from which an assertion was extracted, you can use the following python commands: ```python import spacy nlp = spacy.load('en_core_web_sm') nlp.add_pipe("sentencizer") nlp.select_pipes(enable=["sentencizer"]) doc = wiki_corpus[articleId]['text'] doc = nlp(doc) sents = list(doc.sents) this_sent = sents[lineId].text print(this_sent) ``` Note that you would first need to run `python -m spacy download en_core_web_sm` before running the above script.

数据集信息: 特征: - 名称:articleId,数据类型:int64 - 名称:lineId,数据类型:int64 - 名称:factId,数据类型:int64 - 名称:text,数据类型:string - 名称:subj,数据类型:string - 名称:pred,数据类型:string - 名称:auxi,序列类型:string - 名称:prep1,数据类型:string - 名称:obj1,数据类型:string - 名称:prep2,数据类型:string - 名称:obj2,数据类型:string - 名称:prep3,数据类型:string - 名称:obj3,数据类型:string - 名称:prep4,数据类型:string - 名称:obj4,数据类型:string - 名称:prep5,数据类型:string - 名称:obj5,数据类型:string 划分集: - 名称:train,字节数:86532750060,样本数:439305160 下载大小:31248975339 数据集总大小:86532750060 配置: - 配置名称:default,数据文件: - 划分集:train,路径:data/train-* # WikiAssertions:源自维基百科的断言数据集 WikiAssertions 包含维基百科中的所有断言(又称原子事实,Atomic Facts)。本数据集通过在分句后的[维基百科(Wikipedia)](https://huggingface.co/datasets/wikipedia)语料库上运行[高性能多值开放信息抽取(Open IE)系统](https://github.com/Teddy-Li/MulVOIEL/)构建而成。本研究用于处理语料库的完全一致的模型检查点(model checkpoint)可从 [Teddy487/LLaMA3-8b-for-OpenIE](https://huggingface.co/Teddy487/LLaMA3-8b-for-OpenIE) 下载。 断言为多值关系元组,用于表示原子层面的事实类信息。 举例如以下语句: `Earlier this year , President Bush made a final `` take - it - or - leave it '' offer on the minimum wage` 可提取得到如下断言: <<span style="color:#2471A3">布什总统</span>, <span style="color:#A93226">提出</span>, <span style="color:#138D75">最终的“要么接受要么放弃”方案</span>, <span style="color:#B7950B ">关于最低工资</span>, <span style="color:#B9770E">今年早些时候</span>>> 我们将在下文介绍该数据集的格式,如需更多信息,请参考我们的 [GitHub 仓库(Github Repository)](https://github.com/Teddy-Li/MulVOIEL/) 与模型卡片(Model Card):[Teddy487/LLaMA2-7b-for-OpenIE](https://huggingface.co/Teddy487/LLaMA2-7b-for-OpenIE)、[**Teddy487/LLaMA3-8b-for-OpenIE**](https://huggingface.co/Teddy487/LLaMA3-8b-for-OpenIE)。 ## 数据格式 该数据集中的每一条条目均为一条维基百科中的断言。断言的格式为如下多值关系元组: `<subj> ,, (<auxi> ###) <predicate> ,, (<prep1> ###) <obj1>, (<prep2> ###) <obj2>, ...` 一条断言包含一个主语、一个谓语(本质为动词)、一个可选的辅助成分(如否定词、情态动词等),以及若干宾语(0个、1个、2个等)。每个宾语可附带一个可选的前置词(例如 on、with、for 等)。 该数据集的格式详述如下: ### 元数据列: 1. articleId:对应 [维基百科(Wikipedia)](https://huggingface.co/datasets/wikipedia) 语料库中文档的id字段值。 2. lineId:使用 [spaCy 分句器(spaCy sentencizer)](https://spacy.io/api/sentencizer) 分句后,单文档内的句子编号。 3. factId:单句子内的断言编号。 ### 内容列: 1. text:以自然语言文本形式呈现的断言。 2. subj:断言的主语。 3. pred:断言的谓语(即核心动词)。 4. (可选)auxi:断言的辅助成分(如否定词、情态动词等) 5. (可选)prep1:第一个宾语的前置词(可留空); 6. (可选)obj1:第一个宾语(及物动词通常对应直接宾语,不及物动词可留空)。 7. (可选)prep2:第二个宾语的前置词(可留空); 8. (可选)obj2:第二个宾语 9. (可选)prep3:第三个宾语的前置词(可留空); 10.(可选)obj3:第三个宾语 11.(可选)prep4:第四个宾语的前置词(可留空); 12.(可选)obj4:第四个宾语 13.(可选)prep5:第五个宾语的前置词(可留空); 14.(可选)obj5:第五个宾语 请注意,每条断言最多设置5个宾语槽位。若一条断言包含更多论元,则超出的论元将被忽略。 若谓语为轻动词(light verb,https://en.wikipedia.org/wiki/Light_verb),则轻动词本身无法提供足够的语义来消歧事件类型。此时,我们会将第一个宾语(`obj1`)合并至`pred`字段中。仅当第一个宾语未附带前置词(即`prep1`为空)时,才执行此操作;否则,将该断言视为异常并予以丢弃。 ## 与维基百科原始文本的映射 数据集中每条断言对应的原始文本可从 Hugging Face 平台上的 [维基百科(Wikipedia)](https://huggingface.co/datasets/wikipedia) 语料库中获取。本数据集使用的是`20220301.en`版本的维基百科,可通过以下 Python 代码加载: python from datasets import load_dataset wiki_corpus = load_dataset("wikipedia", "20220301.en", split='train') 数据集中的`articleId`字段对应加载后的语料库中的文档`id`字段。 若需定位提取断言的原始句子,可使用以下 Python 代码: python import spacy nlp = spacy.load('en_core_web_sm') nlp.add_pipe("sentencizer") nlp.select_pipes(enable=["sentencizer"]) doc = wiki_corpus[articleId]['text'] doc = nlp(doc) sents = list(doc.sents) this_sent = sents[lineId].text print(this_sent) 请注意,在运行上述代码前,需先执行`python -m spacy download en_core_web_sm`安装依赖。

提供机构:
Teddy487
原始信息汇总

WikiAssertions 数据集概述

数据集信息

特征列

  • articleId: 文档ID,类型为 int64
  • lineId: 句子ID,类型为 int64
  • factId: 断言ID,类型为 int64
  • text: 断言的自然语言文本表示,类型为 string
  • subj: 断言的主语,类型为 string
  • pred: 断言的谓语(主要动词),类型为 string
  • auxi: 断言的辅助元素(否定、情态动词等),类型为 string 序列
  • prep1: 对象1的介词,类型为 string
  • obj1: 对象1,类型为 string
  • prep2: 对象2的介词,类型为 string
  • obj2: 对象2,类型为 string
  • prep3: 对象3的介词,类型为 string
  • obj3: 对象3,类型为 string
  • prep4: 对象4的介词,类型为 string
  • obj4: 对象4,类型为 string
  • prep5: 对象5的介词,类型为 string
  • obj5: 对象5,类型为 string

数据分割

  • train: 训练集,包含 439,305,160 个样本,总大小为 86,532,750,060 字节

数据集大小

  • 下载大小: 31,248,975,339 字节
  • 数据集大小: 86,532,750,060 字节

配置

  • default: 默认配置,训练数据文件路径为 data/train-*

数据格式

每个条目是一个来自维基百科的断言。断言是一个多价关系元组,格式如下:

<subj> ,, (<auxi> ###) <predicate> ,, (<prep1> ###) <obj1>, (<prep2> ###) <obj2>, ...

断言包括一个主语、一个谓语(主要是动词)、一个可选的辅助元素(否定、情态动词等)以及多个对象(0、1、2等)。每个对象可能带有一个可选的介词(例如 on、with、for 等)。

元数据列

  1. articleId: 文档ID,对应维基百科语料库中的 id 列。
  2. lineId: 句子ID,使用 spaCy sentencizer 进行句子分割。
  3. factId: 句子中的断言ID。

内容列

  1. text: 断言的自然语言文本表示。
  2. subj: 断言的主语。
  3. pred: 断言的谓语(主要动词)。
  4. (可选) auxi: 断言的辅助元素(否定、情态动词等)。
  5. (可选) prep1: 对象1的介词(可以为空)。
  6. (可选) obj1: 对象1(通常是及物动词的直接宾语,对于不及物动词可以为空)。
  7. (可选) prep2: 对象2的介词(可以为空)。
  8. (可选) obj2: 对象2。
  9. (可选) prep3: 对象3的介词(可以为空)。
  10. (可选) obj3: 对象3。
  11. (可选) prep4: 对象4的介词(可以为空)。
  12. (可选) obj4: 对象4。
  13. (可选) prep5: 对象5的介词(可以为空)。
  14. (可选) obj5: 对象5。

注意,每个断言最多保留5个对象槽。如果断言涉及更多参数,溢出的参数将被忽略。

当谓语是 轻动词 时,轻动词本身不足以消除事件的歧义。因此,在这种情况下,我们将第一个对象 (obj1) 合并到 pred 字段中。仅当第一个对象不带介词(即 prep1 为空)时,我们才会这样做;否则,我们将其视为异常并丢弃该断言。

与维基百科原文的映射

数据集中每个断言的原始文本可以在 Huggingface 的维基百科语料库中找到。我们使用 20220301.en 版本的维基百科,可以使用以下 Python 命令加载:

python from datasets import load_dataset

wiki_corpus = load_dataset("wikipedia", "20220301.en", split=train)

数据集中的 articleId 字段对应加载数据集中的文档 id

如果您希望定位从中提取断言的确切句子,可以使用以下 Python 命令:

python import spacy

nlp = spacy.load(en_core_web_sm) nlp.add_pipe("sentencizer") nlp.select_pipes(enable=["sentencizer"])

doc = wiki_corpus[articleId][text] doc = nlp(doc) sents = list(doc.sents)

this_sent = sents[lineId].text

print(this_sent)

注意,在运行上述脚本之前,您需要先运行 python -m spacy download en_core_web_sm

搜集汇总
数据集介绍
Teddy487/WikiAssertions 数据集图片
构建方式
WikiAssertions数据集源自对维基百科语料库的深度语义解析。研究者采用基于LLaMA3-8B模型构建的强多价开放信息抽取系统MulVOIEL,对经过句子切分的维基百科文本进行逐句处理,从中抽取出原子级别的事实性断言。每个断言被形式化为包含主语、谓语、可选辅助成分及最多五个带介词宾语的多元关系元组,确保了结构化语义信息的完整捕获。
特点
该数据集的核心特征在于其规模宏大与结构精细。其训练集包含约4.39亿个断言实例,覆盖维基百科的广泛知识领域。每个断言不仅记录文本形式的陈述,还通过元数据字段(如文章ID、句子ID、断言ID)维持与原始语料的精确映射。此外,针对谓语为轻动词等特殊语言现象,数据集采用融合宾语至谓语的策略,提升了语义表示的准确性。
使用方法
研究者可通过HuggingFace Datasets库轻松加载此数据集,并利用其提供的articleId字段与维基百科语料库(20220301.en版本)建立关联。若要定位断言对应的原始句子,可借助spaCy的sentencizer对目标文章文本进行句子分割,再依据lineId索引获取确切语句。数据集提供了标准化的元组格式,便于直接应用于信息检索、知识图谱构建及自然语言理解等任务的模型训练与评估。
背景与挑战
背景概述
WikiAssertions数据集由研究者Teddy Li及其团队于近期创建,旨在从维基百科海量文本中提取原子级事实断言。该数据集基于多价开放信息抽取系统MulVOIEL,利用微调的LLaMA3-8B模型对维基百科2022年3月1日英文语料进行结构化解析,生成超过4.39亿条多价关系元组。每个断言以<主语,谓语,宾语>为核心骨架,并支持最多五个带介词的可选宾语槽位,同时处理否定、情态动词等复杂语言现象。这一资源为知识图谱构建、自然语言推理及事实性问答等任务提供了大规模、高质量的基准数据,显著推动了开放信息抽取领域从简单三元组向多价事实表达的范式演进。
当前挑战
数据集面临的核心挑战包括:其一,开放信息抽取本身的技术瓶颈——如何从复杂句式中精准识别多价关系,尤其在处理轻动词结构时需动态合并宾语与谓语字段,且对溢出参数采取截断策略可能损失信息完整性;其二,构建过程中的工程挑战——需在4.39亿条断言中确保跨句子、跨文档的事实一致性,避免因分词器或句边界识别错误导致的断言碎片化;其三,数据质量与覆盖率的平衡——模型依赖预设的五个宾语槽位,当实际关系超出此限制时被迫丢弃参数,同时介词缺失的异常断言被直接过滤,可能引入系统性偏见。
常用场景
经典使用场景
WikiAssertions数据集的核心应用在于为开放信息抽取(OpenIE)任务提供大规模、高质量的监督训练与评估基准。该数据集基于Wikipedia语料,通过多价开放信息抽取系统自动生成原子化事实断言,每条数据以<主语,谓语,宾语,修饰成分>的多价元组形式呈现,涵盖多达五个宾语槽位及可选的介词与助动词结构。研究者可借此训练模型从非结构化文本中抽取结构化事实,尤其适用于处理复杂句式中多论元关系的抽取任务,成为自然语言理解领域中事实抽取与知识图谱构建的重要数据基石。
衍生相关工作
该数据集衍生了一系列经典研究工作,包括基于LLaMA系列模型微调的专用OpenIE模型(如Teddy487/LLaMA3-8b-for-OpenIE),这些模型在WikiAssertions上训练后展现出卓越的断言抽取能力。此外,研究者基于该数据集探索了多价关系表示学习、跨语言开放信息抽取以及断言一致性验证等方向。例如,部分工作利用其结构化元组设计,将断言转化为知识图谱嵌入,进而提升下游推理任务的性能。该数据集还催生了针对Wikipedia文本的细粒度事件抽取与语义角色标注研究,成为连接自然语言处理与知识工程的桥梁性资源。
数据集最近研究
最新研究方向
在知识图谱构建与开放信息抽取领域,WikiAssertions数据集凭借其大规模、多价态原子事实的精细标注,正成为推动语义解析与常识推理研究的前沿基石。该数据集基于LLaMA3-8B模型对维基百科全量语料进行结构化抽取,生成了涵盖4.39亿条断言的超大规模知识库,每条断言以<主语、谓语、辅佐成分、多客体及介词>的标准化元组形式呈现,突破了传统三元组在表达复杂事件关系时的局限性。当前,研究热点聚焦于利用该数据集训练能够理解嵌套语义、处理光动词及多介词结构的深度语言模型,从而提升机器对事实性文本的细粒度理解能力。此外,WikiAssertions与维基百科原文的精确映射机制,为验证知识一致性、消解语义歧义以及构建可解释AI系统提供了可靠的基准数据源,在自动问答、事实验证及知识增强型对话系统等前沿应用中展现出重要影响。
以上内容由遇见数据集搜集并总结生成
二维码
社区交流群
二维码
科研交流群
商业服务