WO2022100357A1 - 一种构建部署文本实体关系提取模型的方法和存储设备 - Google Patents

一种构建部署文本实体关系提取模型的方法和存储设备 Download PDF

Info

Publication number
WO2022100357A1
WO2022100357A1 PCT/CN2021/123941 CN2021123941W WO2022100357A1 WO 2022100357 A1 WO2022100357 A1 WO 2022100357A1 CN 2021123941 W CN2021123941 W CN 2021123941W WO 2022100357 A1 WO2022100357 A1 WO 2022100357A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
evaluation
model
training
preset specification
Prior art date
Application number
PCT/CN2021/123941
Other languages
English (en)
French (fr)
Inventor
伍臣周
庄莉
苏江文
王秋琳
宋立华
Original Assignee
福建亿榕信息技术有限公司
国网信息通信产业集团有限公司
国网信通亿力科技有限责任公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 福建亿榕信息技术有限公司, 国网信息通信产业集团有限公司, 国网信通亿力科技有限责任公司 filed Critical 福建亿榕信息技术有限公司
Publication of WO2022100357A1 publication Critical patent/WO2022100357A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition

Definitions

  • the invention relates to the technical field of data processing, in particular to a method and a storage device for constructing and deploying a text entity relationship extraction model.
  • the framework relies heavily on the Huawei ecosystem.
  • One of its main shortcomings is that it is necessary to purchase HUAWEI CLOUD servers for data and model storage; the second deficiency is: the intervention points for data pre-processing and post-processing are not reserved; the third deficiency is: the model is only supported on HUAWEI CLOUD servers It can not be deployed in a specific local area network, such as the intranet environment of the State Grid.
  • Baidu ecosystem relies heavily on the Baidu ecosystem.
  • One of its main shortcomings is that it is necessary to purchase Baidu cloud server for data and model storage; the second one is: the intervention point of data pre-processing and post-processing is not reserved; the third one is: the model only supports the Baidu cloud server It can not be deployed in a specific local area network, such as the intranet environment of the State Grid.
  • a method for constructing and deploying a text entity relationship extraction model comprising the steps of:
  • the marked data is divided into different types of data, and the different types of data include one or more of the following: training data, test data, and evaluation data, and store the different types of data in a corresponding data storage directory;
  • Model evaluation is performed on the trained training model according to the processed test data and the processed evaluation data, and if the evaluation is qualified, the model that has passed the evaluation will be released.
  • the first preset specification includes one or more of the following: defining a project naming format, defining process data, model source code, auxiliary tools, and related document storage directories;
  • the second preset specification includes one or more of the following: defining a data storage directory naming format, defining original data, preprocessing data, labeling data, training data storage directory, test data storage directory, and evaluation data storage directory;
  • the third preset specification includes: converting an unstructured document into a plain text document;
  • the fourth preset specification includes: using json format to store label data, and generating a json file from a plain text document;
  • the fifth preset specification includes one or more of the following: quantity distribution of various types of data, quantity of entities included in various types of data, labeling quality, labeling method and length.
  • the “segmented data is divided into different types of data, and the different types of data include one or more of the following: training data, test data, evaluation data, and storing the different types of data to corresponding the datastore directory", also includes steps:
  • the sixth preset specification includes: storing the original text, entity type, relationship type, entity details, and entity relationship details to different json files respectively;
  • test data is divided according to the seventh preset specification, and the test data includes one or more of the following: original data, tag type data, and relation type data;
  • the evaluation data is divided according to the eighth preset specification, and the evaluation data includes one or more of the following: entity labeling data and entity relationship data.
  • model evaluation on the trained training model according to the processed test data and the processed evaluation data also includes the steps:
  • the processed test data and the processed evaluation data are calculated by the model evaluation script to obtain the evaluation index value, and the evaluation index value includes one or more of the following: precision rate, recall rate, F1 value;
  • Whether the training model can be released is determined by comprehensively analyzing different evaluation dimensions of the training model, where the different evaluation dimensions include one or more of the following: evaluation index value, operating environment, and Badcase analysis.
  • the "publishing a model qualified for the evaluation” further includes the steps:
  • the training of the evaluation-qualified model is automatically constructed, the running environment of the model is packaged and mirrored, and the evaluation-qualified model is released according to the model release specification.
  • the marked data is divided into different types of data, and the different types of data include one or more of the following: training data, test data, and evaluation data, and store the different types of data in a corresponding data storage directory;
  • Model evaluation is performed on the trained training model according to the processed test data and the processed evaluation data, and if the evaluation is qualified, the model that has passed the evaluation will be released.
  • the first preset specification includes one or more of the following: defining a project naming format, defining process data, model source code, auxiliary tools, and related document storage directories;
  • the second preset specification includes one or more of the following: defining a data storage directory naming format, defining original data, preprocessing data, labeling data, training data storage directory, test data storage directory, and evaluation data storage directory;
  • the third preset specification includes: converting an unstructured document into a plain text document;
  • the fourth preset specification includes: using json format to store label data, and generating a json file from a plain text document;
  • the fifth preset specification includes one or more of the following: quantity distribution of various types of data, quantity of entities included in various types of data, labeling quality, labeling method and length.
  • the instruction set is also used to execute: the “segmented data is divided into different types of data, and the different types of data include one or more of the following: training data, test data, evaluation data. , and store the different types of data in the corresponding data storage directory", which also includes the steps:
  • the sixth preset specification includes: storing the original text, entity type, relationship type, entity details, and entity relationship details to different json files respectively;
  • test data is divided according to the seventh preset specification, and the test data includes one or more of the following: original data, tag type data, and relation type data;
  • the evaluation data is divided according to the eighth preset specification, and the evaluation data includes one or more of the following: entity labeling data and entity relationship data.
  • the instruction set is also used to execute: the "model evaluation of the trained training model according to the processed test data and the processed evaluation data", further comprising the steps of:
  • the processed test data and the processed evaluation data are calculated by the model evaluation script to obtain the evaluation index value, and the evaluation index value includes one or more of the following: precision rate, recall rate, comprehensive evaluation index (F1- Measure) F1 value;
  • Whether the training model can be released is determined by comprehensively analyzing different evaluation dimensions of the training model, where the different evaluation dimensions include one or more of the following: evaluation index value, operating environment, and Badcase analysis.
  • the instruction set is also used to execute: the "then release a model qualified for the evaluation", further comprising the steps of:
  • the training of the evaluation-qualified model is automatically constructed, the running environment of the model is packaged and mirrored, and the evaluation-qualified model is released according to the model release specification.
  • a project project is created according to the first preset specification on the source code management platform, and a data storage directory is created according to the second preset specification on the data storage platform;
  • the data is preprocessed, and the preprocessed data is stored in the corresponding data storage directory;
  • the preprocessed data is marked according to the fourth preset specification, the evaluation data is extracted, and the data is stored according to the fifth preset specification.
  • the evaluation data is used for data evaluation; the marked data is divided into different types of data, and the different types of data include one or more of the following: training data, test data, evaluation data, and storing the different types of data to In the corresponding data storage directory; process the training data, input the processed training data to the training model for training to obtain a trained model; perform model evaluation on the trained model according to the test data and the evaluation data, if If the evaluation is qualified, the model that passes the evaluation will be released.
  • FIG. 1 is a flowchart of a method for constructing and deploying a text entity relationship extraction model according to the specific embodiment
  • FIG. 3 is a schematic diagram of the project environment initialization process according to the specific embodiment
  • FIG. 5 is a schematic diagram of the ftp data storage directory specification according to the specific embodiment
  • FIG. 6 is a schematic diagram of a data preprocessing sub-flow according to the specific embodiment
  • FIG. 7 is a schematic diagram of a data labeling sub-flow according to the specific embodiment.
  • FIG. 8 is a schematic diagram of annotated data evaluation dimension according to the specific embodiment.
  • FIG. 9 is a schematic diagram of the model training sub-flow according to the specific embodiment.
  • FIG. 10 is a schematic diagram of the model evaluation sub-flow according to the specific embodiment.
  • FIG. 11 is a schematic diagram of the model evaluation dimension according to the specific embodiment.
  • FIG. 14 is a schematic block diagram of a storage device according to an embodiment.
  • a method for constructing and deploying a text entity relationship extraction model can be applied to a storage device, and the storage device includes but is not limited to: a personal computer, a server, a general-purpose computer , special computer, network equipment, embedded equipment, programmable equipment, etc.
  • the storage device includes but is not limited to: a personal computer, a server, a general-purpose computer , special computer, network equipment, embedded equipment, programmable equipment, etc.
  • Step S101 Create a project project on the source code management platform according to the first preset specification, and create a data storage directory on the data storage platform according to the second preset specification.
  • Step S102 Collect data, preprocess the data according to a third preset specification, and store the preprocessed data in a corresponding data storage directory.
  • Step S103 Label the preprocessed data according to the fourth preset specification, extract evaluation data, and perform data evaluation on the evaluation data according to the fifth preset specification.
  • Step S104 Divide the marked data into different types of data, and the different types of data include one or more of the following: training data, test data, and evaluation data, and store the different types of data in corresponding data storage in the directory.
  • Step S105 Select a training model, process the different types of data to conform to the data format received by the training model, and input the processed training data to train the training model.
  • Step S106 Model evaluation is performed on the trained training model according to the processed test data and the processed evaluation data, and if the evaluation is qualified, the model that has passed the evaluation is released.
  • the first preset specification in the above text corresponds to specification 1 in the accompanying drawings.
  • the second preset specification corresponds to specification 2 in the accompanying drawings
  • the third preset specification corresponds to Specification 3 in the drawing
  • the nth preset specification corresponds to specification n in the drawing.
  • step S101 corresponds to the project environment initialization in FIG. 2
  • step S102 corresponds to the data preprocessing in FIG. 2
  • steps S103 and S104 correspond to the data annotation in FIG. 2
  • step S105 corresponds to the model in FIG. 2 training
  • step S106 corresponds to the model evaluation and service release in FIG. 2 .
  • the source code management platform may be gitlab or svn.
  • gitlab is used as an example
  • ftp is used as an example for the data storage platform.
  • Figure 3 The two structures are shown in Figure 3.
  • the first preset specification includes one or more of the following: defining a project naming format, defining process data, model source code, auxiliary tools, and related document storage directories. As shown in Figure 4.
  • the second preset specification includes one or more of the following: defining a data storage directory naming format, defining original data, preprocessing data, labeling data, training data storage directory, test data storage directory, and evaluation data storage directory. As shown in Figure 5.
  • step S101 Two tools are involved in step S101:
  • Tool 1 Automatically create gitlab project scripts, users can choose python, java and other languages to write and automatically create gitlab project script tools.
  • Tool 2 Automatically create an ftp directory script, the user can choose any language such as python, java, etc. to write a tool to automatically create an ftp directory script.
  • step S102 with reference to FIG. 6 :
  • the third preset specification includes: converting the unstructured document into a plain text document. Specifically, it can be as follows: Convert unstructured documents (such as word, pdf, ceb documents, etc.) into plain text (txt) documents to lay the foundation for subsequent data annotation.
  • Tool 3 Plain text conversion tool, based on Tika components encapsulated by external libraries provided by apache and ceb, to realize document plain text conversion.
  • Steps S103 and S104 are described below in conjunction with FIG. 7 and FIG. 8 :
  • the fourth preset specification includes: using the json format to store the annotation data, and generating a json file from a plain text document.
  • the json data contains 6 keys, such as data identification, file name, file content, label category, label, entity relationship category, and entity relationship.
  • the value corresponding to some keys is list or object.
  • the specific format is as follows:
  • labelCategories corresponds to the set of entity types to be extracted.
  • the format is as follows:
  • the labels correspond to the entity information set to be extracted.
  • the format is as follows:
  • connectionCategories corresponds to the set of entity relationship types to be extracted, which can be null, and the format is as follows:
  • connections corresponds to the set of relationships between entities to be extracted, which can be null, and the format is as follows:
  • the fifth preset specification includes one or more of the following: quantity distribution of various types of data, quantity of entities included in various types of data, labeling quality, labeling method and length.
  • the specifics can be as follows: Labeling data evaluation specifications, when data labeling is completed, sampling evaluation must be carried out. According to the evaluation results, it is decided whether to carry out follow-up work. It can be analyzed from various dimensions (original labeled data, model training data, model evaluation data, sampling evaluation data) data quantity, distribution of various data entities, labeling quality, labeling method, labeling time and other dimensions.
  • step S104 also includes steps:
  • the training data is divided according to a sixth preset specification, and the sixth preset specification includes: storing the text source, entity type, relationship type, entity details, and entity relationship details in different json files respectively. It is convenient for later expansion and flexible use.
  • test data is divided according to the seventh preset specification, and the test data includes one or more of the following: original data, tag type data, and relation type data.
  • the format of each type of data is json, and each type of data format corresponds to the original data, label type data, and relation type data in the training data set.
  • the evaluation data is divided according to the eighth preset specification, and the evaluation data includes one or more of the following: entity labeling data and entity relationship data.
  • entity labeling data and entity relationship data.
  • the format of each type of data is json, and each type of data format corresponds to the entity annotation data and entity relationship data in the training data set.
  • Tool 4 Labeling tool, users can decide whether to develop their own text entity relationship labeling tool or choose to use a third-party labeling tool based on their own situation.
  • Tool 5 Annotation data and standard data, excel interconversion tool, based on the defined annotation data format and model standard input and output data format, write two data interconversion tools to speed up the rapid flow of data in the framework of the text entity relationship extraction pipeline .
  • Tool 6 Data segmentation tool, which realizes the segmentation of labeled data into data such as model training, evaluation, and test sets.
  • Step S105 will be specifically described below with reference to FIG. 9 :
  • step S105 a data specification and a script tool are defined, and some of the previously defined specifications are referenced, and the previously prepared training data, evaluation data, and test data are mainly converted into the requirements required by the model training framework through the script tool. format, and then carry out model training.
  • Model data conversion data specification which defines the data format of model training, evaluation, test set and other data formats output by tool 6 into the data input and output format rules required by the selected model training framework, which is convenient for model training.
  • Tool 7 Data conversion tool, which needs to be combined with the model training, evaluation, test data format and the input and output data format of the selected model training framework to write a data conversion tool.
  • Step S106 will be specifically described below with reference to FIGS. 10 to 13 :
  • step S106 three data specifications and two script tools are defined, and some of the previously defined specifications are referenced, and model prediction and model evaluation are mainly carried out for text entity relationship extraction.
  • Model output data specification which defines the model prediction output data format and the model evaluation data format, which is convenient for model evaluation.
  • Model evaluation scheme which defines the precision rate (Precision, P), recall rate (Recall, R), and the comprehensive evaluation index F1 value (F1-measure, F1) to evaluate the effect of entity relationship extraction. -averaging) to calculate the above-mentioned P, R, F1 and other indicators, that is, the statistical indicator value of each class is first calculated, and then the arithmetic mean is calculated for all classes.
  • the macro average calculation formula is as follows:
  • Model evaluation specification When the model training is completed, the test data and evaluation data need to be used to calculate the accuracy rate, recall rate and F1 value of the model extraction entity through the model evaluation script, and analyze whether the indicators meet the expectations. . According to the evaluation results, it is decided whether to release the service. It can be analyzed from the dimensions of model performance indicators, operating environment, and badcase. The model evaluation dimensions are shown in Figure 11.
  • Model prediction script you need to combine the selected text entity relationship to extract the model training framework and the defined and standardized model prediction data and model output data format, and write the model prediction script.
  • Model evaluation script which needs to be combined with the defined model evaluation data and model output data format, combined with the model evaluation plan, to write a model evaluation script.
  • the "then release the evaluation-qualified model” further includes the steps of: automatically constructing the training of the evaluation-qualified model, packaging and mirroring the operating environment of the model, and releasing the evaluation according to the model release specification. Qualified model. In this step, two specifications and one tool are defined, relying on jenkins and dockerhub to realize one-click training of text entity relation extraction model and service deployment based on docker image. Use jenkins to implement online training of the model and package the model running environment into the docker image by writing the dockerfile file, which reduces the difficulty of building the model running environment and improves the speed of model deployment.
  • Model release specification which defines the specific results to be released when the model is released, including the model deployment package, SDK, and related guidance documents.
  • Tool 10 docker image packaging tool, which can realize one-click production of model docker image package by writing sh file.
  • tuning extension points are reserved in data preprocessing, labeling, algorithm writing, network parameter adjustment, quality assessment, etc., so that the baseline model can be further optimized to build an entity relationship extraction model that meets business requirements. .
  • model training and deployment environment is built based on the docker method, which simplifies the installation of model dependent packages (such as tensorflow and pytorch), so that the model running environment can be quickly built in the intranet environment.
  • model dependent packages such as tensorflow and pytorch
  • a specific implementation manner of a storage device 1400 is as follows:
  • a storage device 1400 in which an instruction set is stored, and the instruction set is used to execute: create a project project according to a first preset specification on a source code management platform, and create a data storage directory according to a second preset specification on the data storage platform; Collecting data, preprocessing the data according to the third preset specification, and storing the preprocessed data in the corresponding data storage directory; marking the preprocessed data according to the fourth preset specification, Extracting evaluation data, and performing data evaluation on the evaluation data according to the fifth preset specification; dividing the labeled data into different types of data, and the different types of data include one or more of the following: training data, Test data and evaluation data, store the different types of data in the corresponding data storage directory; select a training model, process the different types of data to conform to the data format received by the training model, and input the processed training The training model is trained with the data; model evaluation is performed on the trained training model according to the processed test data and the processed evaluation data, and if the evaluation is qualified, the qualified
  • the first preset specification includes one or more of the following: defining a project naming format, defining process data, model source code, auxiliary tools, and related document storage directories;
  • the second preset specification includes the following: One or more of: defining the naming format of the data storage directory, defining the original data, preprocessing data, labeling data, training data storage directory, test data storage directory, and evaluation data storage directory;
  • the third preset specification includes: Converting an unstructured document into a plain text document;
  • the fourth preset specification includes: using json format to store label data, and a plain text document generates a json file;
  • the fifth preset specification includes one of the following Or multiple types: the distribution of various types of data, the number of entities included in various types of data, the quality of annotation, the method of annotation, and the length of time.
  • the instruction set is also used to execute: the “segmented data is divided into different types of data, and the different types of data include one or more of the following: training data, test data, evaluation data. , and store the different types of data in the corresponding data storage directory,” further comprising the step of: dividing the training data according to a sixth preset specification, where the sixth preset specification includes: the original text, entity type, relationship type, Entity details and entity relationship details are respectively stored in different json files; test data is divided according to the seventh preset specification, and the test data includes one or more of the following: raw data, tag type data, and relationship type data; The evaluation data is divided according to the eighth preset specification, and the evaluation data includes one or more of the following: entity labeling data and entity relationship data.
  • the instruction set is also used to execute: the "model evaluation is performed on the trained training model according to the processed test data and the processed evaluation data", further comprising the step of: using a model evaluation script to evaluate the processed data.
  • the test data and the processed evaluation data are calculated to obtain an evaluation index value, and the evaluation index value includes one or more of the following: accuracy rate, recall rate, and F1 value; Whether the training model can be released, the different evaluation dimensions include one or more of the following: evaluation index value, operating environment, and Badcase analysis.
  • the instruction set is also used to execute: the "then release the model qualified for evaluation", further comprising the steps of: automatically constructing the training of the model qualified for evaluation, and packaging the running environment of the model Mirror processing, and release the evaluation-qualified model according to the model release specification.
  • Type data into the corresponding data storage directory process the training data, input the processed training data to the training model for training to obtain a trained model; model the trained model according to the test data and evaluation data Evaluation, if the evaluation is qualified, the model that passes the evaluation will be released.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)
  • Document Processing Apparatus (AREA)

Abstract

本发明涉及数据处理技术领域,特别涉及一种构建部署文本实体关系提取模型的方法和存储设备。所述一种构建部署文本实体关系提取模型的方法,包括步骤:创建项目工程,创建数据存储目录;采集数据,对所述数据进行预处理;根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;对标注后的数据进行切分成不同类型数据;选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式;根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。通过上述技术方案大大降低自然语言处理技术的应用门槛。

Description

一种构建部署文本实体关系提取模型的方法和存储设备 技术领域
本发明涉及数据处理技术领域,特别涉及一种构建部署文本实体关系提取模型的方法和存储设备。
背景技术
在我国信息化建设过程中,各行各业都产生了大量的非结构化数据(如word、pdf、ceb等文档)。如何挖掘非结构化数据价值,成为当今的一个热点问题。随着自然语言处理技术的快速发展,使用自然语言处理技术将难以分析的非结构化数据转换为易于分析的结构化数据,是挖掘非结构化数据价值的一种有效方式。其中,文本实体关系提取是非结构化数据转结构化数据的重要环节。通过提取文本数据中的实体、关系,结合文本主题识别和内容相关性分析,能够为后续的文本自动分类、推荐、领域知识图谱的构建等应用场景提供结构化数据的支撑。
目前,市面上有很多基于机器学习或深度学习的文本实体关系提取的技术方案和技术实现。也有很多专家、学者提出了各个领域内(如医疗、司法、音乐等)的文本实体关系提取的优化方案,能够提升领域内实体提取的效果。然而,在项目中并不是每个人都掌握机器学习及深度学习技术和能够搭建其运行环境;在项目前期也不一定需要追求文本实体关系提取的高准确率和召回率等指标。很多时候,当具备一定数据时,人们会希望通过某种框架快速的实现文本实体关系模型的构建及评估,并且能够基于框架预留的调优点开展模型调优,最后还能够简易地模型服务部署。
在工业界,目前有以下几种文本实体关系提取方法和框架:
1、华为AI开发平台ModelArts
该框架严重依赖于华为生态圈。它的主要不足之一是:必须购买华为云服务器进行数据、模型的存储;不足之二是:未预留数据前处理和后处理的介入点;不足之三是:模型仅支持在华为云服务器上发布部署,不能够在特定的局域网内部署,如国家电网的内网环境。
2、百度EasyDL定制AI训练平台
该框架严重依赖于百度生态圈。它的主要不足之一是:必须购买百度云服务器进行数据、模型的 存储;不足之二是:未预留数据前处理和后处理的介入点;不足之三是:模型仅支持在百度云服务器上发布部署,不能够在特定的局域网内部署,如国家电网的内网环境。
综上所述,不管是华为还是百度提供的AI训练平台,虽然实现了从数据标注到模型发布全过程的可视化操作,但除了需要收费外,还存在着灵活性不够、未提供数据处理工具及预留人工调优介入点等不足之处。无法满足企业对于训练平台的自主可控和内网环境应用的需求。
发明内容
为此,需要提供一种构建部署文本实体关系提取模型的方法,用以解决现有文本实体关系提取技术方案存在灵活性不够、未提供数据处理工具及预留人工调优介入点不足等问题。具体技术方案如下:
一种构建部署文本实体关系提取模型的方法,包括步骤:
在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;
采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;
根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;
对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;
选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式,输入处理后的训练数据对所述训练模型进行训练;
根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。
进一步的,所述第一预设规范包括以下中的一种或多种:定义工程命名格式、定义过程数据、模型源码、辅助工具、相关文档存储目录;
所述第二预设规范包括以下中的一种或多种:定义数据存储目录命名格式,定义原始数据、预处理数据、标注数据、训练数据存储目录、测试数据存储目录、评估数据存储目录;
所述第三预设规范包括:将非结构化文档转换为纯文本文档;
所述第四预设规范包括:使用json格式存储标注数据,一份纯文本文档生成一份json文件;
所述第五预设规范包括以下中的一种或多种:各类数据数量分布情况、各类数据包含实体数量情况、标注质量、标注方式及时长。
进一步的,所述“对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中”,还包括步骤:
根据第六预设规范来划分训练数据,所述第六预设规范包括:将文本原本、实体类型、关系类型、实体详情、实体关系详情分别存储至不同的json文件;
根据第七预设规范来划分测试数据,所述测试数据包括以下中的一种或多种:原始数据、标签类型数据、关系类型数据;
根据第八预设规范来划分评估数据,所述评估数据包括以下中的一种或多种:实体标注数据、实体关系数据。
进一步的,所述“根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估”,还包括步骤:
通过模型评估脚本对处理后的测试数据和处理后的评估数据进行计算得评估指标值,所述评估指标值包括以下中的一种或多种:准确率、召回率、F1值;
通过综合分析训练模型的不同评估维度判断所述训练模型是否可发布,所述不同评估维度包括以下中的一种或多种:评估指标值、运行环境、Badcase分析。
进一步的,所述“则发布评估合格的模型”,还包括步骤:
对所述评估合格的模型的训练进行自动化构建,并将所述模型的运行环境进行打包镜像处理,根据模型发布规范发布评估合格的模型。
为解决上述技术问题,还提供了一种存储设备,具体技术方案如下:
一种存储设备,其中存储有指令集,所述指令集用于执行:
在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;
采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;
根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;
对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;
选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式,输入处理后的训练数据对所述训练模型进行训练;
根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。
进一步的,所述第一预设规范包括以下中的一种或多种:定义工程命名格式、定义过程数据、模型源码、辅助工具、相关文档存储目录;
所述第二预设规范包括以下中的一种或多种:定义数据存储目录命名格式,定义原始数据、预处理数据、标注数据、训练数据存储目录、测试数据存储目录、评估数据存储目录;
所述第三预设规范包括:将非结构化文档转换为纯文本文档;
所述第四预设规范包括:使用json格式存储标注数据,一份纯文本文档生成一份json文件;
所述第五预设规范包括以下中的一种或多种:各类数据数量分布情况、各类数据包含实体数量情况、标注质量、标注方式及时长。
进一步的,所述指令集还用于执行:所述“对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中”,还包括步骤:
根据第六预设规范来划分训练数据,所述第六预设规范包括:将文本原本、实体类型、关系类型、实体详情、实体关系详情分别存储至不同的json文件;
根据第七预设规范来划分测试数据,所述测试数据包括以下中的一种或多种:原始数据、标签类型数据、关系类型数据;
根据第八预设规范来划分评估数据,所述评估数据包括以下中的一种或多种:实体标注数据、实体关系数据。
进一步的,所述指令集还用于执行:所述“根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估”,还包括步骤:
通过模型评估脚本对处理后的测试数据和处理后的评估数据进行计算得到评估指标值,所述评估指标值包括以下中的一种或多种:准确率、召回率、综合评价指标(F1-Measure)F1值;
通过综合分析训练模型的不同评估维度判断所述训练模型是否可发布,所述不同评估维度包括以下中的一种或多种:评估指标值、运行环境、Badcase分析。
进一步的,所述指令集还用于执行:所述“则发布评估合格的模型”,还包括步骤:
对所述评估合格的模型的训练进行自动化构建,并将所述模型的运行环境进行打包镜像处理,根据模型发布规范发布评估合格的模型。
本发明的有益效果是:在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;对所述训练数据进行处理,输入处理后的训练数据至训练模型进行训练得训练后的模型;根据所述测试数据和评估数据对训练后的模型进行模型评估,若评估合格,则发布评估合格的模型。通过上述技术方案用户可搭建自己的模型训练平台,且在数据标注就绪的情况下,不需要编写代码,即可快速训练出较高质量的实体关系抽取模型,降低自然语言处理技术的应用门槛。
附图说明
图1为具体实施方式所述一种构建部署文本实体关系提取模型的方法的流程图;
图2为具体实施方式所述文本实体关系提取流水线框架图;
图3为具体实施方式所述项目环境初始化流程示意图;
图4为具体实施方式所述gitlab工程目录结构规范示意图;
图5为具体实施方式所述ftp数据存储目录规范示意图;
图6为具体实施方式所述数据预处理子流程示意图;
图7为具体实施方式所述数据标注子流程示意图;
图8为具体实施方式所述标注数据评估维度示意图;
图9为具体实施方式所述模型训练子流程示意图;
图10为具体实施方式所述模型评估子流程示意图;
图11为具体实施方式所述模型评估维度示意图;
图12为具体实施方式所述模型服务发布子环节示意图;
图13为具体实施方式所述dockerfile内容编写规范示意图;
图14为具体实施方式所述一种存储设备的模块示意图。
附图标记说明:
1400、存储设备。
具体实施方式
为详细说明技术方案的技术内容、构造特征、所实现目的及效果,以下结合具体实施例并配合附图详予说明。
请参阅图1至图13,在本实施方式中,一种构建部署文本实体关系提取模型的方法可应用在一种存储设备上,所述存储设备包括但不限于:个人计算机、服务器、通用计算机、专用计算机、网络设备、嵌入式设备、可编程设备等。具体技术方案如下:
步骤S101:在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录。
步骤S102:采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中。
步骤S103:根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估。
步骤S104:对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中。
步骤S105:选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式,输入处理后的训练数据对所述训练模型进行训练。
步骤S106:根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。
需要说明的是,上述文字中第一预设规范即对应的是附图中的规范1,同理,第二预设规范对应的是附图中的规范2,第三预设规范对应的是附图中的规范3,以此类推,第n预设规范对应的是附图中的规范n。
其中步骤S101对应的即附图2中的项目环境初始化,步骤S102对应附图2中的数据预处理,步骤S103和步骤S104对应附图2中的数据标注,步骤S105对应附图2中的模型训练,步骤S106则对应附图2中的模型评估和服务发布。
以下会对这些步骤与环节一一展开说明:
如图3至图5所示,在本实施方式中,源码管理平台可以为gitlab或svn,在本实施方式中,以gitlab为例,数据存储平台以ftp为例。二者结构如图3所示。
其中所述第一预设规范包括以下中的一种或多种:定义工程命名格式、定义过程数据、模型源码、辅助工具、相关文档存储目录。如图4所示。
所述第二预设规范包括以下中的一种或多种:定义数据存储目录命名格式,定义原始数据、预处理数据、标注数据、训练数据存储目录、测试数据存储目录、评估数据存储目录。如图5所示。
在步骤S101中涉及两个工具:
工具1:自动创建gitlab工程脚本,用户可任选python、java等语言编写自动创建gitlab工程脚本工具。
工具2:自动创建ftp目录脚本,用户可任选python、java等语言编写自动创建ftp目录脚本工具。
以下结合图6,对步骤S102展开说明:
由于在不同场景下数据收集方式各异,对数据的处理方式与收集到的数据形态强关联,但将非结构化文档转纯文本数据,在文本实体关系抽取的数据预处理过程中基本都会涉及。因此,该环节主要定义了一种规范和一种工具,并引用了前面定义规范。
所述第三预设规范包括:将非结构化文档转换为纯文本文档。具体可如下:将非结构化文档(如word、pdf、ceb文档等)转换为纯文本(txt)文档,为后续数据标注奠定基础。
工具3:纯文本转换工具,基于apache和ceb提供的外部库封装的Tika组件,实现文档纯文本转换。
以下结合图7和图8,对步骤S103和S104展开说明:
其中步骤S103和步骤S104中定义了五种数据规范和三个脚本工具,并引用了前面定义的部分规范。
所述第四预设规范包括:使用json格式存储标注数据,一份纯文本文档生成一份json文件。json数据包含数据标识、文件名称、文件内容、标签类别、标签、实体关系类别、实体关系等6个key,部分key对应的value为list或object。具体格式如下:
json结构
字段名称 schema value类型 备注
数据标识 id string  
文件名称 title string  
文件内容 content string  
标签类别 labelCategories list 为所有待抽取的实体类型集
标签 labels list 为待抽取实体的位置信息集
实体关系类别 connectionCategories list 为待抽取实体关系类型集
实体关系 connections list 为待抽取实体关系集
labelCategories对应待抽取实体类型集合,格式如下:
字段名称 schema value类型 备注
标签标识 id int  
标签值 text string  
labels对应待抽取实体信息集合,格式如下:
字段名称 schema value类型 备注
实体标识 id int  
实体类型 categoryId int  
起始位置 startIndex int 从0开始
结束位置 endIndex int 从0开始
connectionCategories对应待抽取实体关系类型集合,可为空值,格式如下:
字段名称 schema value类型 备注
实体关系标识 id int  
实体关系值 text string  
connections对应待抽取实体之间关系集合,可为空值,格式如下:
字段名称 schema value类型 备注
关系标识 id int  
关系类型 categoryId int  
起始实体 fromId int 从0开始
结束实体 toId int 从0开始
所述第五预设规范包括以下中的一种或多种:各类数据数量分布情况、各类数据包含实体数量情况、标注质量、标注方式及时长。具体可如下:标注数据评估规范,当完成数据标注后,必须进行抽样评估。根据评估结果在决定是否开展后续工作。可以从各类(原始标注数据、模型训练数据、模型 评估数据、抽样评估数据)数据数量、各类数据实体分布情况、标注质量、标注方式、标注时长等维度进行分析。
其中步骤S104还包括步骤:
根据第六预设规范来划分训练数据,所述第六预设规范包括:将文本原本、实体类型、关系类型、实体详情、实体关系详情分别存储至不同的json文件。便于后期的扩充及灵活使用。
各类数据格式如下表:
表:原始文本数据(source)json结构
字段名称 schema value类型 备注
数据标识 id string  
文件名称 title string  
文件内容 content string  
表:标签类型(labelCategories)json结构
字段名称 schema value类型 备注
标签标识 id int  
标签名称 text string  
表:关系类型(connectionCategories)json结构
字段名称 schema value类型 备注
关系标识 id int  
关系名称 text string  
表:实体标注(labels)json结构
字段名称 schema value类型 备注
实体标识 id int  
原始数据标识 srcId string 对应source内的id
标签类型标识 categoryId int 对应labelCategories内的id
实体值 value string value=content[startIndex:endIndex+1]
起始位置 startIndex int 从0开始
结束位置 endIndex int 从0开始
表:实体关系(connections)json结构
字段名称 schema value类型 备注
关系标识 id int  
原始数据标识 srcId string 对应source内的id
关系类型标识 categoryId int 对应connectionCategories内的id
起始实体 fromId int 从0开始
结束实体 toId int 从0开始
根据第七预设规范来划分测试数据,所述测试数据包括以下中的一种或多种:原始数据、标签类型数据、关系类型数据。每类数据格式为json,每类数据格式分别对应训练数据集中的原始数据、标签类型数据、关系类型数据。
根据第八预设规范来划分评估数据,所述评估数据包括以下中的一种或多种:实体标注数据、实 体关系数据。每类数据格式为json,每类数据格式分别对应训练数据集中的实体标注数据、实体关系数据。
工具4:标注工具,用户可以基于自身情况决定是研发自己的文本实体关系标注工具,还是选择使用第三方标注工具。
工具5:标注数据与标准数据、excel互转工具,基于已定义的标注数据格式和模型标准输入输出数据格式,编写两种数据互转工具,加快数据在文本实体关系提取流水线框架内的快速流转。
工具6:数据切分工具,实现将标注数据切分成模型训练、评估、测试集等数据。
以下结合图9对步骤S105进行具体说明:
目前,市面上已有很多开源的文本实体关系提取框架,用户可以基于自身研发实力选择基于tensorflow或pytorch封装自己的文本实体关系提取框架,也可直接从网上下载开源的框架。当选定好框架后(即选定好模型训练框架),需要将前面定义好的模型训练/评估/测试等数据格式,在框架内部进行转换。
在步骤S105中定义了一种数据规范和一种脚本工具,并引用部分前面已定义的规范,主要通过脚本工具将前面准备好的训练数据、评估数据、测试数据转换成模型训练框架所要求的格式,然后开展模型训练。
规范9:模型数据转换数据规范,定义了将工具6输出的模型训练、评估、测试集等数据格式转换成所选模型训练框架所要求的数据输入输出格式规则,便于开展模型训练。
工具7:数据转换工具,需结合模型训练、评估、测试数据格式和所选模型训练框架输入输出数据格式,编写数据转换工具。
以下结合图10至图13对步骤S106进行具体说明:
在步骤S106中定义了三种数据规范和两种脚本工具,并引用部分前面已定义的规范,主要开展文本实体关系提取模型预测和模型评估。
规范10:模型输出结果数据规范,定义了模型预测输出数据格式同模型评估数据格式,便于开展模型评估。
规范11:模型评估方案,定义了精确率(Precision,P)、召回率(Recall,R)、综合评价指标F1值(F1-measure,F1)来评估实体关系提取的效果,采用宏平均(Macro-averaging)计算上述P、R、F1等指标,即先对每一个类统计指标值,然后在对所有类求算术平均值。宏平均计算公式 如下:
Figure PCTCN2021123941-appb-000001
Figure PCTCN2021123941-appb-000002
Figure PCTCN2021123941-appb-000003
最终模型的性能以F1值为基准。
规范12:模型评估规范,当完成模型训练后,需使用测试数据和评估数据,通过模型评估脚本计算模型抽取实体的准确率、召回率及F1值等指标,并对各指标进行分析是否到达预期。根据评估结果再决定是否发布服务。可以从模型性能指标、运行环境、badcase等维度进行分析。模型评估维度如图11所示。
工具8:模型预测脚本,需结合选定的文本实体关系提取模型训练框架和已定义的规范的模型预测数据和模型输出数据格式,编写模型预测脚本。
工具9:模型评估脚本,需结合已定义的模型评估数据和模型输出数据格式,结合模型评估方案,编写模型评估脚本。
进一步的,所述“则发布评估合格的模型”,还包括步骤:对所述评估合格的模型的训练进行自动化构建,并将所述模型的运行环境进行打包镜像处理,根据模型发布规范发布评估合格的模型。该步骤中定义了两种规范和一种工具,依托于jenkins和dockerhub实现文本实体关系提取模型一键训练和基于docker镜像的服务部署。使用jenkins实现模型的在线训练并通过编写dockerfile文件,实现模型运行环境打包至docker镜像,降低模型运行环境搭建难度,提升模型部署速度。
规范13:docker打包规范,定义了Dockerfile内容格式,如图14所示。
规范14:模型发布规范,定义模型发布时所需发布的具体成果,包含模型部署包、SDK、相关的指导文档等。
工具10:docker镜像打包工具,通过编写sh文件,实现模型docker镜像包的一键制作。
在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范 对所述评估数据进行数据评估;对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;对所述训练数据进行处理,输入处理后的训练数据至训练模型进行训练得训练后的模型;根据所述测试数据和评估数据对训练后的模型进行模型评估,若评估合格,则发布评估合格的模型。通过上述技术方案用户可搭建自己的模型训练平台,且在数据标注就绪的情况下,不需要编写代码,即可快速训练出较高质量的实体关系抽取模型,降低自然语言处理技术的应用门槛。
进一步的,本技术方案中,在数据预处理、标注、算法编写、网络调参、质量评估等环节预留调优扩展点,从而可进一步持续优化baseline模型构建出满足业务要求的实体关系抽取模型。
进一步的,在本技术方案中,基于docker方式,实现模型训练和部署环境的搭建,简化了模型依赖包(如tensorflow、pytorch)的安装,从而能够在内网环境快速搭建模型运行环境。
请参阅图14,在本实施方式中,一种存储设备1400的具体实施方式如下:
一种存储设备1400,其中存储有指令集,所述指令集用于执行:在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式,输入处理后的训练数据对所述训练模型进行训练;根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。
进一步的,所述第一预设规范包括以下中的一种或多种:定义工程命名格式、定义过程数据、模型源码、辅助工具、相关文档存储目录;所述第二预设规范包括以下中的一种或多种:定义数据存储目录命名格式,定义原始数据、预处理数据、标注数据、训练数据存储目录、测试数据存储目录、评估数据存储目录;所述第三预设规范包括:将非结构化文档转换为纯文本文档;所述第四预设规范包括:使用json格式存储标注数据,一份纯文本文档生成一份json文件;所述第五预设规范包括以下中的一种或多种:各类数据数量分布情况、各类数据包含实体数量情况、标注质量、标注方式及时长。
进一步的,所述指令集还用于执行:所述“对标注后的数据进行切分成不同类型数据,所述不同 类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中”,还包括步骤:根据第六预设规范来划分训练数据,所述第六预设规范包括:将文本原本、实体类型、关系类型、实体详情、实体关系详情分别存储至不同的json文件;根据第七预设规范来划分测试数据,所述测试数据包括以下中的一种或多种:原始数据、标签类型数据、关系类型数据;根据第八预设规范来划分评估数据,所述评估数据包括以下中的一种或多种:实体标注数据、实体关系数据。
进一步的,所述指令集还用于执行:所述“根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估”,还包括步骤:通过模型评估脚本对处理后的测试数据和处理后的评估数据进行计算得评估指标值,所述评估指标值包括以下中的一种或多种:准确率、召回率、F1值;通过综合分析训练模型的不同评估维度判断所述训练模型是否可发布,所述不同评估维度包括以下中的一种或多种:评估指标值、运行环境、Badcase分析。
进一步的,所述指令集还用于执行:所述“则发布评估合格的模型”,还包括步骤:对所述评估合格的模型的训练进行自动化构建,并将所述模型的运行环境进行打包镜像处理,根据模型发布规范发布评估合格的模型。
以上各步骤的具体实现与上述一种构建部署文本实体关系提取模型的方法相同,在此不做重复说明。
通过存储设备1400上的指令集执行:在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;对所述训练数据进行处理,输入处理后的训练数据至训练模型进行训练得训练后的模型;根据所述测试数据和评估数据对训练后的模型进行模型评估,若评估合格,则发布评估合格的模型。通过上述技术方案用户可搭建自己的模型训练平台,且在数据标注就绪的情况下,不需要编写代码,即可快速训练出较高质量的实体关系抽取模型,降低自然语言处理技术的应用门槛。
需要说明的是,尽管在本文中已经对上述各实施例进行了描述,但并非因此限制本发明的专利保 护范围。因此,基于本发明的创新理念,对本文所述实施例进行的变更和修改,或利用本发明说明书及附图内容所作的等效结构或等效流程变换,直接或间接地将以上技术方案运用在其他相关的技术领域,均包括在本发明的专利保护范围之内。

Claims (10)

  1. 一种构建部署文本实体关系提取模型的方法,其特征在于,包括步骤:
    在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;
    采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;
    根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;
    对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;
    选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式,输入处理后的训练数据对所述训练模型进行训练;
    根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。
  2. 根据权利要求1所述的一种构建部署文本实体关系提取模型的方法,其特征在于,
    所述第一预设规范包括以下中的一种或多种:定义工程命名格式、定义过程数据、模型源码、辅助工具、相关文档存储目录;
    所述第二预设规范包括以下中的一种或多种:定义数据存储目录命名格式,定义原始数据、预处理数据、标注数据、训练数据存储目录、测试数据存储目录、评估数据存储目录;
    所述第三预设规范包括:将非结构化文档转换为纯文本文档;
    所述第四预设规范包括:使用json格式存储标注数据,一份纯文本文档生成一份json文件;
    所述第五预设规范包括以下中的一种或多种:各类数据数量分布情况、各类数据包含实体数量情况、标注质量、标注方式及时长。
  3. 根据权利要求1所述的一种构建部署文本实体关系提取模型的方法,其特征在于,所述“对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中”,还包括步骤:
    根据第六预设规范来划分训练数据,所述第六预设规范包括:将文本原本、实体类型、关系类型、实体详情、实体关系详情分别存储至不同的json文件;
    根据第七预设规范来划分测试数据,所述测试数据包括以下中的一种或多种:原始数据、标签类型数据、关系类型数据;
    根据第八预设规范来划分评估数据,所述评估数据包括以下中的一种或多种:实体标注数据、实体关系数据。
  4. 根据权利要求1所述的一种构建部署文本实体关系提取模型的方法,其特征在于,所述“根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估”,还包括步骤:
    通过模型评估脚本对处理后的测试数据和处理后的评估数据进行计算得到评估指标值,所述评估指标值包括以下中的一种或多种:准确率、召回率、综合评价指标(F1-Measure)F1值;
    通过综合分析训练模型的不同评估维度判断所述训练模型是否可发布,所述不同评估维度包括以下中的一种或多种:评估指标值、运行环境、Badcase分析。
  5. 根据权利要求1所述的一种构建部署文本实体关系提取模型的方法,其特征在于,所述“则发布评估合格的模型”,还包括步骤:
    对所述评估合格的模型的训练进行自动化构建,并将所述模型的运行环境进行打包镜像处理,根据模型发布规范发布评估合格的模型。
  6. 一种存储设备,其中存储有指令集,其特征在于,所述指令集用于执行:
    在源码管理平台上按第一预设规范创建项目工程,在数据存储平台按第二预设规范创建数据存储目录;
    采集数据,并按第三预设规范对所述数据进行预处理,并存储预处理后的数据至对应的数据存储目录中;
    根据第四预设规范对所述预处理后的数据进行标注,抽取评估数据,并根据第五预设规范对所述评估数据进行数据评估;
    对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中;
    选定训练模型,并将所述不同类型数据进行处理使得符合所述训练模型接收的数据格式,输入处理后的训练数据对所述训练模型进行训练;
    根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估,若评估合格,则发布评估合格的模型。
  7. 根据权利要求6所述的一种存储设备,其特征在于,所述第一预设规范包括以下中的一种或 多种:定义工程命名格式、定义过程数据、模型源码、辅助工具、相关文档存储目录;
    所述第二预设规范包括以下中的一种或多种:定义数据存储目录命名格式,定义原始数据、预处理数据、标注数据、训练数据存储目录、测试数据存储目录、评估数据存储目录;
    所述第三预设规范包括:将非结构化文档转换为纯文本文档;
    所述第四预设规范包括:使用json格式存储标注数据,一份纯文本文档生成一份json文件;
    所述第五预设规范包括以下中的一种或多种:各类数据数量分布情况、各类数据包含实体数量情况、标注质量、标注方式及时长。
  8. 根据权利要求6所述的一种存储设备,其特征在于,所述指令集还用于执行:所述“对标注后的数据进行切分成不同类型数据,所述不同类型数据包括以下中的一种或多种:训练数据、测试数据、评估数据,存储所述不同类型数据至对应的数据存储目录中”,还包括步骤:
    根据第六预设规范来划分训练数据,所述第六预设规范包括:将文本原本、实体类型、关系类型、实体详情、实体关系详情分别存储至不同的json文件;
    根据第七预设规范来划分测试数据,所述测试数据包括以下中的一种或多种:原始数据、标签类型数据、关系类型数据;
    根据第八预设规范来划分评估数据,所述评估数据包括以下中的一种或多种:实体标注数据、实体关系数据。
  9. 根据权利要求6所述的一种存储设备,其特征在于,所述指令集还用于执行:所述“根据处理后的测试数据和处理后的评估数据对训练后的训练模型进行模型评估”,还包括步骤:
    通过模型评估脚本对处理后的测试数据和处理后的评估数据进行计算得评估指标值,所述评估指标值包括以下中的一种或多种:准确率、召回率、F1值;
    通过综合分析训练模型的不同评估维度判断所述训练模型是否可发布,所述不同评估维度包括以下中的一种或多种:评估指标值、运行环境、Badcase分析。
  10. 根据权利要求6所述的一种存储设备,其特征在于,所述指令集还用于执行:所述“则发布评估合格的模型”,还包括步骤:
    对所述评估合格的模型的训练进行自动化构建,并将所述模型的运行环境进行打包镜像处理,根据模型发布规范发布评估合格的模型。
PCT/CN2021/123941 2020-11-12 2021-10-14 一种构建部署文本实体关系提取模型的方法和存储设备 WO2022100357A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011258349.7A CN112417083B (zh) 2020-11-12 2020-11-12 一种构建部署文本实体关系提取模型的方法和存储设备
CN202011258349.7 2020-11-12

Publications (1)

Publication Number Publication Date
WO2022100357A1 true WO2022100357A1 (zh) 2022-05-19

Family

ID=74781115

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/123941 WO2022100357A1 (zh) 2020-11-12 2021-10-14 一种构建部署文本实体关系提取模型的方法和存储设备

Country Status (2)

Country Link
CN (1) CN112417083B (zh)
WO (1) WO2022100357A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780110A (zh) * 2022-06-21 2022-07-22 山东极视角科技有限公司 一种算法链路的优化方法及优化系统
CN116561317A (zh) * 2023-05-25 2023-08-08 暨南大学 基于文本导向的人格预测方法、标注方法、系统及设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112417083B (zh) * 2020-11-12 2022-05-17 福建亿榕信息技术有限公司 一种构建部署文本实体关系提取模型的方法和存储设备
CN114756211B (zh) * 2022-05-13 2022-12-16 北京百度网讯科技有限公司 模型训练方法、装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202044A (zh) * 2016-07-07 2016-12-07 武汉理工大学 一种基于深度神经网络的实体关系抽取方法
CN110442725A (zh) * 2019-08-14 2019-11-12 科大讯飞股份有限公司 实体关系抽取方法及装置
CN111476034A (zh) * 2020-04-07 2020-07-31 同方赛威讯信息技术有限公司 基于规则和模型结合的法律文书信息抽取方法及系统
CN112417083A (zh) * 2020-11-12 2021-02-26 福建亿榕信息技术有限公司 一种构建部署文本实体关系提取模型的方法和存储设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8200487B2 (en) * 2003-11-21 2012-06-12 Nuance Communications Austria Gmbh Text segmentation and label assignment with user interaction by means of topic specific language models and topic-specific label statistics
CN106815293A (zh) * 2016-12-08 2017-06-09 中国电子科技集团公司第三十二研究所 一种面向情报分析的构建知识图谱的系统及方法
US11574204B2 (en) * 2017-12-06 2023-02-07 Accenture Global Solutions Limited Integrity evaluation of unstructured processes using artificial intelligence (AI) techniques
CN110399433A (zh) * 2019-07-23 2019-11-01 福建奇点时空数字科技有限公司 一种基于深度学习的数据实体关系抽取方法
CN110688456A (zh) * 2019-09-25 2020-01-14 北京计算机技术及应用研究所 一种基于知识图谱的漏洞知识库构建方法
CN111597420B (zh) * 2020-04-29 2023-06-02 西安理工大学 基于深度学习的轨道交通规范关系抽取方法
CN111813950B (zh) * 2020-05-20 2024-02-27 淮阴工学院 一种基于神经网络自适应寻优调参的建筑领域知识图谱构建方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202044A (zh) * 2016-07-07 2016-12-07 武汉理工大学 一种基于深度神经网络的实体关系抽取方法
CN110442725A (zh) * 2019-08-14 2019-11-12 科大讯飞股份有限公司 实体关系抽取方法及装置
CN111476034A (zh) * 2020-04-07 2020-07-31 同方赛威讯信息技术有限公司 基于规则和模型结合的法律文书信息抽取方法及系统
CN112417083A (zh) * 2020-11-12 2021-02-26 福建亿榕信息技术有限公司 一种构建部署文本实体关系提取模型的方法和存储设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780110A (zh) * 2022-06-21 2022-07-22 山东极视角科技有限公司 一种算法链路的优化方法及优化系统
CN116561317A (zh) * 2023-05-25 2023-08-08 暨南大学 基于文本导向的人格预测方法、标注方法、系统及设备

Also Published As

Publication number Publication date
CN112417083A (zh) 2021-02-26
CN112417083B (zh) 2022-05-17

Similar Documents

Publication Publication Date Title
WO2022100357A1 (zh) 一种构建部署文本实体关系提取模型的方法和存储设备
WO2018218708A1 (zh) 一种基于深度学习的舆情热点类别划分方法
Stanisławek et al. Kleister: key information extraction datasets involving long documents with complex layouts
WO2019075466A1 (en) SYSTEM AND METHOD FOR ANALYSIS OF STRUCTURED AND UNSTRUCTURED DATA
WO2018000269A1 (zh) 一种基于数据挖掘和众包的数据标注方法及系统
JP7150842B2 (ja) 文書構造抽出に基づいた多言語文書の検索
CN103207855A (zh) 针对产品评论信息的细粒度情感分析系统及方法
Han et al. Visual inspection with federated learning
CN103559234A (zh) RESTful Web服务的自动化语义标注系统和方法
Cui et al. A mixed-initiative approach to reusing infographic charts
Braga et al. Contributions and limits to the use of softwares to support content analysis
Ivanov et al. Extracting software requirements from unstructured documents
KR102269606B1 (ko) 콜드 스타트를 해결하기 위한 신규 컨텐츠 분석 분석 방법, 장치 및 컴퓨터 프로그램
CN114118068B (zh) 训练文本数据的扩增方法、装置及电子设备
Schmidt et al. Leveraging textual information for improving decision-making in the business process lifecycle
US10558981B1 (en) Methods systems and articles of manufacture for generating tax worksheet application
Anand et al. Context-Enhanced Language Models for Generating Multi-paper Citations
JP2022082525A (ja) 機械学習基盤情報の提供方法および装置
Munyaradzi et al. Quality assessment in crowdsourced indigenous language transcription
Kravets On approach for the development of patents analysis formal metrics
Abghari et al. Multi-View Clustering Analyses for District Heating Substations
Chen et al. Automatic generation of UML diagrams from product requirements described by natural language
Masiero et al. Creating personas to reuse on diversified projects
Theptakob et al. A Cross-Document Coreference Resolution Approach to Low-Resource Languages
Kohan et al. Automated dataset construction from web resources with tool Kayur

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21890884

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21890884

Country of ref document: EP

Kind code of ref document: A1