前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >【关系抽取-R-BERT】加载数据集

【关系抽取-R-BERT】加载数据集

作者头像
西西嘛呦
发布于 2021-03-16 06:54:20
发布于 2021-03-16 06:54:20
1.5K00
代码可运行
举报
运行总次数:0
代码可运行

认识数据集

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Component-Whole(e2,e1)	The system as described above has its greatest application in an arrayed <e1> configuration </e1> of antenna <e2> elements </e2>.
Other	The <e1> child </e1> was carefully wrapped and bound into the <e2> cradle </e2> by means of a cord.
Instrument-Agency(e2,e1)	The <e1> author </e1> of a keygen uses a <e2> disassembler </e2> to look at the raw assembly code.
Other	A misty <e1> ridge </e1> uprises from the <e2> surge </e2>.
Member-Collection(e1,e2)	The <e1> student </e1> <e2> association </e2> is the voice of the undergraduate student population of the State University of New York at Buffalo.
Other	This is the sprawling <e1> complex </e1> that is Peru's largest <e2> producer </e2> of silver.
Cause-Effect(e2,e1)	The current view is that the chronic <e1> inflammation </e1> in the distal part of the stomach caused by Helicobacter pylori <e2> infection </e2> results in an increased acid production from the non-infected upper corpus region of the stomach.
Entity-Destination(e1,e2)	<e1> People </e1> have been moving back into <e2> downtown </e2>.
Content-Container(e1,e2)	The <e1> lawsonite </e1> was contained in a <e2> platinum crucible </e2> and the counter-weight was a plastic crucible with metal pieces.
Entity-Destination(e1,e2)	The solute was placed inside a beaker and 5 mL of the <e1> solvent </e1> was pipetted into a 25 mL glass <e2> flask </e2> for each trial.
Member-Collection(e1,e2)	The fifty <e1> essays </e1> collected in this <e2> volume </e2> testify to most of the prominent themes from Professor Quispel's scholarly career.
Other	Their <e1> composer </e1> has sunk into <e2> oblivion </e2>.

该数据是SemEval2010 Task8数据集,数据,具体介绍可以参考:https://blog.csdn.net/qq_29883591/article/details/88567561

处理数据相关代码:data_loader.py

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import copy
import csv
import json
import logging
import os

import torch
from torch.utils.data import TensorDataset

from utils import get_label

logger = logging.getLogger(__name__)


class InputExample(object):
    """
    A single training/test example for simple sequence classification.

    Args:
        guid: Unique id for the example.
        text_a: string. The untokenized text of the first sequence. For single
        sequence tasks, only this sequence must be specified.
        label: (Optional) string. The label of the example. This should be
        specified for train and dev examples, but not for test examples.
    """

    def __init__(self, guid, text_a, label):
        self.guid = guid
        self.text_a = text_a
        self.label = label

    def __repr__(self):
        return str(self.to_json_string())

    def to_dict(self):
        """Serializes this instance to a Python dictionary."""
        output = copy.deepcopy(self.__dict__)
        return output

    def to_json_string(self):
        """Serializes this instance to a JSON string."""
        return json.dumps(self.to_dict(), indent=2, sort_keys=True) + "\n"


class InputFeatures(object):
    """
    A single set of features of data.

    Args:
        input_ids: Indices of input sequence tokens in the vocabulary.
        attention_mask: Mask to avoid performing attention on padding token indices.
            Mask values selected in ``[0, 1]``:
            Usually  ``1`` for tokens that are NOT MASKED, ``0`` for MASKED (padded) tokens.
        token_type_ids: Segment token indices to indicate first and second portions of the inputs.
    """

    def __init__(self, input_ids, attention_mask, token_type_ids, label_id, e1_mask, e2_mask):
        self.input_ids = input_ids
        self.attention_mask = attention_mask
        self.token_type_ids = token_type_ids
        self.label_id = label_id
        self.e1_mask = e1_mask
        self.e2_mask = e2_mask

    def __repr__(self):
        return str(self.to_json_string())

    def to_dict(self):
        """Serializes this instance to a Python dictionary."""
        output = copy.deepcopy(self.__dict__)
        return output

    def to_json_string(self):
        """Serializes this instance to a JSON string."""
        return json.dumps(self.to_dict(), indent=2, sort_keys=True) + "\n"


class SemEvalProcessor(object):
    """Processor for the Semeval data set """

    def __init__(self, args):
        self.args = args
        self.relation_labels = get_label(args)

    @classmethod
    def _read_tsv(cls, input_file, quotechar=None):
        """Reads a tab separated value file."""
        with open(input_file, "r", encoding="utf-8") as f:
            reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
            lines = []
            for line in reader:
                lines.append(line)
            return lines

    def _create_examples(self, lines, set_type):
        """Creates examples for the training and dev sets."""
        examples = []
        for (i, line) in enumerate(lines):
            guid = "%s-%s" % (set_type, i)
            text_a = line[1]
            label = self.relation_labels.index(line[0])
            if i % 1000 == 0:
                logger.info(line)
            examples.append(InputExample(guid=guid, text_a=text_a, label=label))
        return examples

    def get_examples(self, mode):
        """
        Args:
            mode: train, dev, test
        """
        file_to_read = None
        if mode == "train":
            file_to_read = self.args.train_file
        elif mode == "dev":
            file_to_read = self.args.dev_file
        elif mode == "test":
            file_to_read = self.args.test_file

        logger.info("LOOKING AT {}".format(os.path.join(self.args.data_dir, file_to_read)))
        return self._create_examples(self._read_tsv(os.path.join(self.args.data_dir, file_to_read)), mode)


processors = {"semeval": SemEvalProcessor}


def convert_examples_to_features(
    examples,
    max_seq_len,
    tokenizer,
    cls_token="[CLS]",
    cls_token_segment_id=0,
    sep_token="[SEP]",
    pad_token=0,
    pad_token_segment_id=0,
    sequence_a_segment_id=0,
    add_sep_token=False,
    mask_padding_with_zero=True,
):
    features = []
    for (ex_index, example) in enumerate(examples):
        if ex_index % 5000 == 0:
            logger.info("Writing example %d of %d" % (ex_index, len(examples)))

        tokens_a = tokenizer.tokenize(example.text_a)

        e11_p = tokens_a.index("<e1>")  # the start position of entity1
        e12_p = tokens_a.index("</e1>")  # the end position of entity1
        e21_p = tokens_a.index("<e2>")  # the start position of entity2
        e22_p = tokens_a.index("</e2>")  # the end position of entity2

        # Replace the token
        tokens_a[e11_p] = "$"
        tokens_a[e12_p] = "$"
        tokens_a[e21_p] = "#"
        tokens_a[e22_p] = "#"

        # Add 1 because of the [CLS] token
        e11_p += 1
        e12_p += 1
        e21_p += 1
        e22_p += 1

        # Account for [CLS] and [SEP] with "- 2" and with "- 3" for RoBERTa.
        if add_sep_token:
            special_tokens_count = 2
        else:
            special_tokens_count = 1
        if len(tokens_a) > max_seq_len - special_tokens_count:
            tokens_a = tokens_a[: (max_seq_len - special_tokens_count)]

        tokens = tokens_a
        if add_sep_token:
            tokens += [sep_token]

        token_type_ids = [sequence_a_segment_id] * len(tokens)

        tokens = [cls_token] + tokens
        token_type_ids = [cls_token_segment_id] + token_type_ids

        input_ids = tokenizer.convert_tokens_to_ids(tokens)

        # The mask has 1 for real tokens and 0 for padding tokens. Only real tokens are attended to.
        attention_mask = [1 if mask_padding_with_zero else 0] * len(input_ids)

        # Zero-pad up to the sequence length.
        padding_length = max_seq_len - len(input_ids)
        input_ids = input_ids + ([pad_token] * padding_length)
        attention_mask = attention_mask + ([0 if mask_padding_with_zero else 1] * padding_length)
        token_type_ids = token_type_ids + ([pad_token_segment_id] * padding_length)

        # e1 mask, e2 mask
        e1_mask = [0] * len(attention_mask)
        e2_mask = [0] * len(attention_mask)

        for i in range(e11_p, e12_p + 1):
            e1_mask[i] = 1
        for i in range(e21_p, e22_p + 1):
            e2_mask[i] = 1

        assert len(input_ids) == max_seq_len, "Error with input length {} vs {}".format(len(input_ids), max_seq_len)
        assert len(attention_mask) == max_seq_len, "Error with attention mask length {} vs {}".format(
            len(attention_mask), max_seq_len
        )
        assert len(token_type_ids) == max_seq_len, "Error with token type length {} vs {}".format(
            len(token_type_ids), max_seq_len
        )

        label_id = int(example.label)

        if ex_index < 5:
            logger.info("*** Example ***")
            logger.info("guid: %s" % example.guid)
            logger.info("tokens: %s" % " ".join([str(x) for x in tokens]))
            logger.info("input_ids: %s" % " ".join([str(x) for x in input_ids]))
            logger.info("attention_mask: %s" % " ".join([str(x) for x in attention_mask]))
            logger.info("token_type_ids: %s" % " ".join([str(x) for x in token_type_ids]))
            logger.info("label: %s (id = %d)" % (example.label, label_id))
            logger.info("e1_mask: %s" % " ".join([str(x) for x in e1_mask]))
            logger.info("e2_mask: %s" % " ".join([str(x) for x in e2_mask]))

        features.append(
            InputFeatures(
                input_ids=input_ids,
                attention_mask=attention_mask,
                token_type_ids=token_type_ids,
                label_id=label_id,
                e1_mask=e1_mask,
                e2_mask=e2_mask,
            )
        )

    return features


def load_and_cache_examples(args, tokenizer, mode):
    processor = processors[args.task](args)

    # Load data features from cache or dataset file
    cached_features_file = os.path.join(
        args.data_dir,
        "cached_{}_{}_{}_{}".format(
            mode,
            args.task,
            list(filter(None, args.model_name_or_path.split("/"))).pop(),
            args.max_seq_len,
        ),
    )

    if os.path.exists(cached_features_file):
        logger.info("Loading features from cached file %s", cached_features_file)
        features = torch.load(cached_features_file)
    else:
        logger.info("Creating features from dataset file at %s", args.data_dir)
        if mode == "train":
            examples = processor.get_examples("train")
        elif mode == "dev":
            examples = processor.get_examples("dev")
        elif mode == "test":
            examples = processor.get_examples("test")
        else:
            raise Exception("For mode, Only train, dev, test is available")

        features = convert_examples_to_features(
            examples, args.max_seq_len, tokenizer, add_sep_token=args.add_sep_token
        )
        logger.info("Saving features into cached file %s", cached_features_file)
        torch.save(features, cached_features_file)

    # Convert to Tensors and build dataset
    all_input_ids = torch.tensor([f.input_ids for f in features], dtype=torch.long)
    all_attention_mask = torch.tensor([f.attention_mask for f in features], dtype=torch.long)
    all_token_type_ids = torch.tensor([f.token_type_ids for f in features], dtype=torch.long)
    all_e1_mask = torch.tensor([f.e1_mask for f in features], dtype=torch.long)  # add e1 mask
    all_e2_mask = torch.tensor([f.e2_mask for f in features], dtype=torch.long)  # add e2 mask

    all_label_ids = torch.tensor([f.label_id for f in features], dtype=torch.long)

    dataset = TensorDataset(
        all_input_ids,
        all_attention_mask,
        all_token_type_ids,
        all_label_ids,
        all_e1_mask,
        all_e2_mask,
    )
    return dataset

这里面用到了utils.py中的get_label函数:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
def get_label(args):
    return [label.strip() for label in open(os.path.join(args.data_dir, args.label_file), "r", encoding="utf-8")]

其中label.txt中的内容如下:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Other
Cause-Effect(e1,e2)
Cause-Effect(e2,e1)
Instrument-Agency(e1,e2)
Instrument-Agency(e2,e1)
Product-Producer(e1,e2)
Product-Producer(e2,e1)
Content-Container(e1,e2)
Content-Container(e2,e1)
Entity-Origin(e1,e2)
Entity-Origin(e2,e1)
Entity-Destination(e1,e2)
Entity-Destination(e2,e1)
Component-Whole(e1,e2)
Component-Whole(e2,e1)
Member-Collection(e1,e2)
Member-Collection(e2,e1)
Message-Topic(e1,e2)
Message-Topic(e2,e1)

最后是这么使用的:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import argparse

from data_loader import load_and_cache_examples
from trainer import Trainer
from utils import init_logger, load_tokenizer, set_seed

def main(args):
    init_logger()
    set_seed(args)
    tokenizer = load_tokenizer(args)

    train_dataset = load_and_cache_examples(args, tokenizer, mode="train")

其中用到了utils.py中的init_logger,load_tokenizer,set_seed:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import logging
import os
import random

import numpy as np
import torch
from transformers import BertTokenizer


ADDITIONAL_SPECIAL_TOKENS = ["<e1>", "</e1>", "<e2>", "</e2>"]


def get_label(args):
    return [label.strip() for label in open(os.path.join(args.data_dir, args.label_file), "r", encoding="utf-8")]


def load_tokenizer(args):
    tokenizer = BertTokenizer.from_pretrained(args.model_name_or_path)
    tokenizer.add_special_tokens({"additional_special_tokens": ADDITIONAL_SPECIAL_TOKENS})
    return tokenizer

其中使用的相关参数的定义如下:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
 parser = argparse.ArgumentParser()

    parser.add_argument("--task", default="semeval", type=str, help="The name of the task to train")
    parser.add_argument(
        "--data_dir",
        default="./data",
        type=str,
        help="The input data dir. Should contain the .tsv files (or other data files) for the task.",
    )
    parser.add_argument("--model_dir", default="./model", type=str, help="Path to model")
    parser.add_argument(
        "--eval_dir",
        default="./eval",
        type=str,
        help="Evaluation script, result directory",
    )
    parser.add_argument("--train_file", default="train.tsv", type=str, help="Train file")
    parser.add_argument("--test_file", default="test.tsv", type=str, help="Test file")
    parser.add_argument("--label_file", default="label.txt", type=str, help="Label file")

    parser.add_argument(
        "--model_name_or_path",
        type=str,
        default="bert-base-uncased",
        help="Model Name or Path",
    )

    parser.add_argument("--seed", type=int, default=77, help="random seed for initialization")
    parser.add_argument("--train_batch_size", default=16, type=int, help="Batch size for training.")
    parser.add_argument("--eval_batch_size", default=32, type=int, help="Batch size for evaluation.")
    parser.add_argument(
        "--max_seq_len",
        default=384,
        type=int,
        help="The maximum total input sequence length after tokenization.",
    )
    parser.add_argument(
        "--learning_rate",
        default=2e-5,
        type=float,
        help="The initial learning rate for Adam.",
    )
    parser.add_argument(
        "--num_train_epochs",
        default=10.0,
        type=float,
        help="Total number of training epochs to perform.",
    )
    parser.add_argument("--weight_decay", default=0.0, type=float, help="Weight decay if we apply some.")
    parser.add_argument(
        "--gradient_accumulation_steps",
        type=int,
        default=1,
        help="Number of updates steps to accumulate before performing a backward/update pass.",
    )
    parser.add_argument("--adam_epsilon", default=1e-8, type=float, help="Epsilon for Adam optimizer.")
    parser.add_argument("--max_grad_norm", default=1.0, type=float, help="Max gradient norm.")
    parser.add_argument(
        "--max_steps",
        default=-1,
        type=int,
        help="If > 0: set total number of training steps to perform. Override num_train_epochs.",
    )
    parser.add_argument("--warmup_steps", default=0, type=int, help="Linear warmup over warmup_steps.")
    parser.add_argument(
        "--dropout_rate",
        default=0.1,
        type=float,
        help="Dropout for fully-connected layers",
    )

    parser.add_argument("--logging_steps", type=int, default=250, help="Log every X updates steps.")
    parser.add_argument(
        "--save_steps",
        type=int,
        default=250,
        help="Save checkpoint every X updates steps.",
    )

    parser.add_argument("--do_train", action="store_true", help="Whether to run training.")
    parser.add_argument("--do_eval", action="store_true", help="Whether to run eval on the test set.")
    parser.add_argument("--no_cuda", action="store_true", help="Avoid using CUDA when available")
    parser.add_argument(
        "--add_sep_token",
        action="store_true",
        help="Add [SEP] token at the end of the sentence",
    )

    args = parser.parse_args()

    main(args)

分步解析数据处理代码

  • 使用的时候是调用load_and_cache_examples(args, tokenizer, mode)函数,其中args参数用于传入初始化的一些参数设置,tokenizer用于将字或符号转换为相应的数字,mode用于标识是训练数据还是验证或者测试数据。
  • 在load_and_cache_examples函数中首先调用processorsargs.task,这个processors是一个字典,字典的键是数据集名称,值是处理该数据集的函数名,当我们使用其它的数据集的时候,我们也要在这里面添加相关的键值对表示。
  • 随后将args参数传入到SemEvalProcessor()函数中。该函数的作用就是生成每一个样本,每一个样本用InputExample类表示,包括样本的唯一标识,文本,标签,最后返回的是包含多个InputExample的列表。
  • 随后通过 convert_examples_to_features( examples, args.max_seq_len, tokenizer, add_sep_token=args.add_sep_token ) 针对于每一个example,都要求得: input_ids=input_ids, attention_mask=attention_mask, token_type_ids=token_type_ids, label_id=label_id, e1_mask=e1_mask, e2_mask=e2_mask, 然后封装成一个InputFeatures,最后返回一个包含多个InputFeatures的列表。 其中还有一些细节我们要清楚的:
    • 需要将实体<e1>、</e1>用$表示,实体<e2>、</e2>用#表示
    • 由于加入了[cls],因此其对应的索引位置要+1
    • 是否需要加入[sep]时要考虑
    • 句子不够长要进行填补,句子太长了要进行截断
  • 最后我们得到相关的列表: dataset = TensorDataset( all_input_ids, all_attention_mask, all_token_type_ids, all_label_ids, all_e1_mask, all_e2_mask, ) 将其转换成TensorDataset并返回。

最后的结果

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
03/14/2021 08:37:37 - INFO - data_loader -   Creating features from dataset file at ./data
03/14/2021 08:37:37 - INFO - data_loader -   LOOKING AT ./data/train.tsv
03/14/2021 08:37:37 - INFO - data_loader -   ['Component-Whole(e2,e1)', 'The system as described above has its greatest application in an arrayed <e1> configuration </e1> of antenna <e2> elements </e2>.']
03/14/2021 08:37:37 - INFO - data_loader -   ['Entity-Destination(e1,e2)', 'A basic <e1> data entry </e1> has been added to the <e2> database </e2>.']
03/14/2021 08:37:37 - INFO - data_loader -   ['Cause-Effect(e2,e1)', "It's hell in the hospitals where the amputees's <e1> screaming </e1> after the <e2> lapse </e2> of morphine is heard all the time."]
03/14/2021 08:37:37 - INFO - data_loader -   ['Cause-Effect(e2,e1)', 'Ironically, the <e1> damage </e1> caused by the <e2> floods </e2>, and the subsequent insurance payout, were what prompted the restoration of the station building.']
03/14/2021 08:37:37 - INFO - data_loader -   ['Other', 'Workers at a Devon hospital are due to strike on 5 January for two days in a <e1> dispute </e1> over sick <e2> pay </e2>.']
03/14/2021 08:37:37 - INFO - data_loader -   ['Product-Producer(e2,e1)', 'The <e1> factory </e1> produced several versions of the RAF-2203 <e2> minibuses </e2> based on GAZ-24.']
03/14/2021 08:37:37 - INFO - data_loader -   ['Other', 'A solar calendar is a calendar whose <e1> dates </e1> indicate the <e2> position </e2> of the earth on its revolution around the sun.']
03/14/2021 08:37:37 - INFO - data_loader -   ['Cause-Effect(e2,e1)', 'The author clearly got a great deal of <e1> pleasure </e1> from the <e2> work </e2> and did not allow his vast amount of material to force him into shallow generalizations.']
03/14/2021 08:37:37 - INFO - data_loader -   Writing example 0 of 8000
03/14/2021 08:37:37 - INFO - data_loader -   *** Example ***
03/14/2021 08:37:37 - INFO - data_loader -   guid: train-0
03/14/2021 08:37:37 - INFO - data_loader -   tokens: [CLS] the system as described above has its greatest application in an array ##ed $ configuration $ of antenna # elements # .
03/14/2021 08:37:37 - INFO - data_loader -   input_ids: 101 1996 2291 2004 2649 2682 2038 2049 4602 4646 1999 2019 9140 2098 1002 9563 1002 1997 13438 1001 3787 1001 1012 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
03/14/2021 08:37:37 - INFO - data_loader -   *** Example ***
03/14/2021 08:37:37 - INFO - data_loader -   guid: train-1
03/14/2021 08:37:37 - INFO - data_loader -   tokens: [CLS] the $ child $ was carefully wrapped and bound into the # cradle # by means of a cord .
03/14/2021 08:37:37 - INFO - data_loader -   input_ids: 101 1996 1002 2775 1002 2001 5362 5058 1998 5391 2046 1996 1001 18293 1001 2011 2965 1997 1037 11601 1012 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
03/14/2021 08:37:37 - INFO - data_loader -   *** Example ***
03/14/2021 08:37:37 - INFO - data_loader -   guid: train-2
03/14/2021 08:37:37 - INFO - data_loader -   tokens: [CLS] the $ author $ of a key ##gen uses a # di ##sas ##se ##mble ##r # to look at the raw assembly code .
03/14/2021 08:37:37 - INFO - data_loader -   input_ids: 101 1996 1002 3166 1002 1997 1037 3145 6914 3594 1037 1001 4487 20939 3366 19661 2099 1001 2000 2298 2012 1996 6315 3320 3642 1012 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
03/14/2021 08:37:37 - INFO - data_loader -   *** Example ***
03/14/2021 08:37:37 - INFO - data_loader -   guid: train-3
03/14/2021 08:37:37 - INFO - data_loader -   tokens: [CLS] a misty $ ridge $ up ##rise ##s from the # surge # .
03/14/2021 08:37:37 - INFO - data_loader -   input_ids: 101 1037 15167 1002 5526 1002 2039 29346 2015 2013 1996 1001 12058 1001 1012 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
03/14/2021 08:37:37 - INFO - data_loader -   *** Example ***
03/14/2021 08:37:37 - INFO - data_loader -   guid: train-4
03/14/2021 08:37:37 - INFO - data_loader -   tokens: [CLS] the $ student $ # association # is the voice of the undergraduate student population of the state university of new york at buffalo .
03/14/2021 08:37:37 - INFO - data_loader -   input_ids: 101 1996 1002 3076 1002 1001 2523 1001 2003 1996 2376 1997 1996 8324 3076 2313 1997 1996 2110 2118 1997 2047 2259 2012 6901 1012 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0
03/14/2021 08:37:37 - INFO - data_loader -   e2_mask: 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
03/14/2021 08:37:40 - INFO - data_loader -   Writing example 5000 of 8000
03/14/2021 08:37:42 - INFO - data_loader -   Saving features into cached file ./data/cached_train_semeval_bert-base-uncased_384

并生成一个:cached_train_semeval_bert-base-uncased_384文件

代码来源:https://github.com/monologg/R-BERT

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-03-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
英文文本关系抽取(fine-tune Huggingface XLNet)
本文主要是基于英文文本关系抽取比赛,讲解如何fine-tune Huggingface的预训练模型,同时可以看作是关系抽取的一个简单案例
mathor
2020/08/31
1.5K0
【关系抽取-mre-in-one-pass】加载数据(一)
在run_classifier.py的main()函数中: 这里定义了一个字典,用于存放不同数据的处理器。
西西嘛呦
2021/03/22
7460
【关系抽取-mre-in-one-pass】加载数据(一)
【关系抽取-R-BERT】模型结构
模型的整体结构 相关代码 import torch import torch.nn as nn from transformers import BertModel, BertPreTrainedMo
西西嘛呦
2021/03/17
9540
BERT+PET方式数据处理
示例中 {MASK} 代表 [MASK] token 的位置,{textA} 代表评论数据的位置。
@小森
2024/06/07
930
BERT+P-Tuning方式数据处理
verbalizer.txt 一共包含10个类别,上述数据中,我们使用了1对1的verbalizer, 如果想定义一对多的映射,只需要在后面用","分割即可, eg:
@小森
2024/06/08
1240
BERT+P-Tuning方式数据处理
如何微调BERT模型进行文本分类
BERT(Bidirectional Encoder Representations from Transformers)在各种自然语言处理任务中提供了最前沿的结果在深度学习社区引起了轰动。德夫林等人。2018 年在 Google 使用英文维基百科和 BookCorpus 开发了 BERT,从那时起,类似的架构被修改并用于各种 NLP 应用程序。XL.net 是建立在 BERT 之上的示例之一,它在 20 种不同任务上的表现优于 BERT。在理解基于 BERT 构建的不同模型之前,我们需要更好地了解 Transformer 和注意力模型。
deephub
2022/01/21
2.6K0
如何微调BERT模型进行文本分类
点亮BERT:3个步骤进行NLP迁移学习
BERT可能是最流行的NLP迁移学习方法。Huggingface的实现提供了许多不错的功能,并在漂亮的API之后抽象了细节。
代码医生工作室
2019/11/29
1.7K0
CAIL2021-阅读理解任务-数据预处理模块(二)
代码地址:https://github.com/china-ai-law-challenge/CAIL2021/
西西嘛呦
2022/06/10
4270
BERT+P-Tuning文本分类模型
@小森
2024/06/09
1660
hugging face-基于pytorch-bert的中文文本分类
wget http://52.216.242.246/models.huggingface.co/bert/bert-base-uncased-vocab.txt
西西嘛呦
2020/12/22
3.9K0
hugging face-基于pytorch-bert的中文文本分类
BERT+PET方式模型训练
@小森
2024/06/08
1310
BERT+PET方式模型训练
【关系抽取-mre-in-one-pass】加载数据(二)
先总体对这些是什么有个大概的了解: (1)res:存储的是相对位置,是一个[128,128]的数组,这里的128是句子的最大长度。这个数组记录的是实体和其它词之间的相对位置。 (2)mas:存储的是实体的mask矩阵,也就是每个句子中实体出现的位置就是1,其它的就是0,也是一个[128,128]的数组 (3)e1_mas:在每一对关系中实体1的掩码矩阵,维度是[12,128],其中12是设置的最大的关系种类数。 (4)e2_mas:在每一对关系中实体2的掩码矩阵,维度是[12,128],其中12是设置的最大的关系种类数。
西西嘛呦
2021/04/12
4570
Huggingface🤗NLP笔记6:数据集预处理,使用dynamic padding构造batch
从这一集,我们就正式开始使用Transformer来训练模型了。今天的部分是关于数据集预处理。
beyondGuo
2021/10/08
5K2
使用huggingface全家桶(transformers, datasets)实现一条龙BERT训练(trainer)和预测(pipeline)
huggingface的transformers在我写下本文时已有39.5k star,可能是目前最流行的深度学习库了,而这家机构又提供了datasets这个库,帮助快速获取和处理数据。这一套全家桶使得整个使用BERT类模型机器学习流程变得前所未有的简单。
blmoistawinde
2021/01/21
5.5K0
【关系抽取-R-BERT】定义训练和验证循环
在训练的时候,我们使用的是RandomSampler采样器,在验证或者测试的时候,我们使用的是SequentialSampler采样器,关于这些采样器的区别,可以去这里看一下: https://chenllliang.github.io/2020/02/04/dataloader/ 这里简要提一下这两种的区别,训练的时候是打乱数据再进行读取,验证的时候顺序读取数据。
西西嘛呦
2021/03/18
9210
【关系抽取-R-BERT】定义训练和验证循环
Paddlenlp之UIE关系抽取模型【高管关系抽取为例】
马云浙江省杭州市人,阿里巴巴集团主要创始人之一。现任阿里巴巴集团主席和首席执行官,他是《福布斯》杂志创办50多年来成为封面人物的首位大陆企业家,曾获选为未来全球领袖。 任正非是中国大陆的民营电信设备企业一-华为公司的创始人兼总裁。 他关于企业“危机管理”的理论与实践曾在业内外产生过广泛影响。 马化腾,是腾讯主要创办人之一现担任公司控股董事会主席兼首席执行官。作为深圳土生土长的企业家,他曾在深圳大学主修计算机及应用,于1993年取得深大理学士学位。 李彦宏是百度公司创始人董事长兼首席执行官,全面负责百度公司的战略规划和运营管理,经过多年发展,百度已经牢牢占据中文搜索引擎超过7成的市场份额。 雷军, 2012年8月其投资创办的小米公司正式发布小米手机。 刘强东,江苏省宿迁市宿豫区人,京东商城的CEO。1996年毕业于中国人民大学社会学系。 柳传志,中国著名企业家,投资家,曾任联想控股有限公司董事长、联想集团有限公司董事局主席。
汀丶人工智能
2022/12/21
1.6K0
“瘦身成功”的ALBERT,能取代BERT吗?
模型的创新点集中在了预训练过程,采用Masked LM和Next Sentence Prediction两种方法,分别捕捉词语和句子级别的表示。
量子位
2020/03/31
9530
“瘦身成功”的ALBERT,能取代BERT吗?
使用预训练模型进行句对分类(Paddle、PyTorch)
预训练模型下载:https://huggingface.co/nghuyong/ernie-1.0
Michael阿明
2021/09/06
1.6K0
实体识别(4) -基于Bert进行商品标题实体识别[很详细]
比赛数据下载地址:商品标题实体识别 https://www.heywhale.com/home/competition/620b34ed28270b0017b823ad
致Great
2023/08/25
3260
Huawei Nezha实践指南
华为的哪吒模型已经面世有一阵子了,而网上一直没有关于哪吒模型的实践文章,所以我打算通过这份指南教会你如何使用nezha进行文本分类。(官网上有一份文本分类的示例代码,但是上千行的代码实在是不利用快速上手)
luxuantao
2021/03/28
1.2K0
推荐阅读
相关推荐
英文文本关系抽取(fine-tune Huggingface XLNet)
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文