WO2023145052A1 - データ変換装置、データ変換方法、およびデータ変換プログラム - Google Patents

データ変換装置、データ変換方法、およびデータ変換プログラム Download PDF

Info

Publication number
WO2023145052A1
WO2023145052A1 PCT/JP2022/003536 JP2022003536W WO2023145052A1 WO 2023145052 A1 WO2023145052 A1 WO 2023145052A1 JP 2022003536 W JP2022003536 W JP 2022003536W WO 2023145052 A1 WO2023145052 A1 WO 2023145052A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
text
structured
semi
structured data
Prior art date
Application number
PCT/JP2022/003536
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 日本電気株式会社
Priority to PCT/JP2022/003536 priority Critical patent/WO2023145052A1/ja
Publication of WO2023145052A1 publication Critical patent/WO2023145052A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/55Rule-based translation
    • G06F40/56Natural language generation

Definitions

  • Patent Literature 1 describes converting data in various formats stored in a data lake into data for creating a prediction model to create a prediction model. Moreover, Patent Literature 1 describes determining the value of each data by obtaining the degree of contribution of each data in the prediction using the prediction model.
  • Patent Document 2 discloses a technique for estimating the meaning of a table
  • Non-Patent Document 1 discloses a technique for estimating a classification class of an image.
  • Using these technologies makes it possible to handle data using a common framework of tags in a data lake where images and tables coexist.
  • the meaning of tables included in the data lake can be estimated using the technique of Patent Document 2, and a tag indicating the estimated meaning can be added.
  • a classification class can be estimated using the technique of Non-Patent Document 1, and a tag indicating the estimated classification class can be added.
  • Patent Document 1 when converting data into data for creating a prediction model, processing is performed to generate a feature vector from material composition information.
  • the data to be evaluated In order to perform such processing, the data to be evaluated must include information on material composition.
  • some data stored in the data lake may or may not contain material composition information. For this reason, when applying the technique of Patent Document 1, it is necessary to check the contents and properties of each data to be evaluated, and to extract data including information on material composition.
  • Patent Document 2 is intended for tables, and it is not possible to estimate the meaning of data in formats other than tables.
  • the technique of Non-Patent Document 1 is intended for images, and in order to estimate classification classes for data other than images, it is necessary to perform machine learning on such data to generate a new classification model. There is In this way, it is not easy to collectively handle data in various formats, such as data stored in a data lake. , it becomes necessary to prepare a classification model.
  • One aspect of the present invention has been made in view of such problems. To provide a technology capable of conversion.
  • a data conversion device includes data acquisition means for acquiring semi-structured data or structured data as target data to be converted into text; data conversion means for converting the target data into text using a semi-structured data template or a structured data template for converting structured data into text.
  • a data conversion method comprises: at least one processor acquiring semi-structured data or structured data as target data to be converted into text; converting the semi-structured data into text; converting the target data to text using a semi-structured data template for conversion or a structured data template for converting structured data to text.
  • a data conversion program comprises data acquisition means for acquiring semi-structured data or structured data as target data to be converted into text, and converting the semi-structured data into text. It functions as data conversion means for converting the target data into text using a semi-structured data template for converting the structured data into text or a structured data template for converting the structured data into text.
  • FIG. 1 is a block diagram showing the configuration of a data conversion device according to exemplary embodiment 1 of the present invention
  • FIG. FIG. 3 is a flow chart showing the flow of a data conversion method according to exemplary embodiment 1 of the present invention
  • FIG. 4 is a diagram showing an example in which target data in various formats are converted into text
  • FIG. 5 is a block diagram showing the configuration of a data conversion device according to exemplary embodiment 2 of the present invention
  • FIG. 10 is a diagram showing an example of a structured data template that is applied when target data is structured data
  • FIG. 10 is a diagram showing an example in which text generated from metadata is added to text generated from target data
  • FIG. 10 is a diagram showing an example of a structured data template that is applied when a table connected by ER exists in target data
  • FIG. 10 is a diagram showing an example of a semi-structured data template applied to semi-structured data having a hierarchical structure
  • FIG. 10 is a diagram showing an example of a semi-structured data template applied to graph-format semi-structured data
  • It is a flowchart which shows the flow of the process which the said data conversion apparatus performs.
  • FIG. 4 is a diagram showing an example of a computer that executes instructions of a program, which is software that implements each function of each device according to each exemplary embodiment of the present invention;
  • FIG. 1 is a block diagram showing the configuration of the data conversion device 1. As shown in FIG. As shown in FIG. 1, the data conversion device 1 includes a data acquisition section 11 and a data conversion section 12 .
  • the data acquisition unit 11 acquires semi-structured data or structured data as target data to be converted into text.
  • the data conversion unit 12 converts the target data into text using a semi-structured data template for converting semi-structured data into text or a structured data template for converting structured data into text. do.
  • the data acquisition unit (11) acquires semi-structured data or structured data as target data to be converted into text;
  • the configuration is adopted. According to this configuration, it is possible to convert the target data into text without grasping the content, nature, etc. of the target data.
  • a data conversion program comprises a computer, data acquisition means for acquiring semi-structured data or structured data as target data to be converted into text, and converting the semi-structured data into text. It functions as data conversion means for converting the target data into text using a semi-structured data template for converting the structured data into text or a structured data template for converting the structured data into text. According to this data conversion program, it is possible to convert the target data into text without grasping the contents, properties, etc. of the target data.
  • FIG. 2 is a flow diagram showing the flow of the data conversion method.
  • the execution entity of each step in this data conversion method may be a processor provided in the data conversion device 1 or a processor provided in another device. provided processor.
  • At S11 at least one processor acquires semi-structured data or structured data as target data to be converted into text.
  • At least one processor converts the target data using a semi-structured data template for converting semi-structured data into text or a structured data template for converting structured data into text. Convert to text.
  • At least one processor acquires semi-structured data or structured data as target data to be converted into text; converting the target data to text using a semi-structured data template for converting structured data to text or a structured data template for converting structured data to text. According to this data conversion method, it is possible to convert the target data into text without grasping the contents, properties, etc. of the target data.
  • FIG. 3 is a diagram showing an example of converting target data in various formats into text.
  • FIG. 3 shows target data D in CSV (Comma Separated Values) format, target data D' in XML (eXtensible Markup Language) format, and knowledge data D' in XML (eXtensible Markup Language) format as examples of target data to be converted into text.
  • CSV Common Separated Values
  • XML eXtensible Markup Language
  • XML eXtensible Markup Language
  • target data in such various formats are converted into text using a predetermined template.
  • a template used for conversion into text may be any template that can generate text from elements included in the target data.
  • a template used for conversion to text can be said to be a conversion rule that indicates how elements contained in target data are to be arranged and converted to text.
  • the template used for conversion to text is, for example, configured so that a character string included in the target data can be incorporated. By incorporating the character string included in the target data into the template, It may be one that converts the target data into text. Further, when converting the target data into text, the conversion may be performed by replacing a predetermined element of the target data with a predetermined character string.
  • the text obtained by this conversion indicates the contents of the target data.
  • the target data is converted using a template in this method, there is no need to perform analysis or confirmation to understand the properties and contents of the target data, and the target data in various formats can be easily handled as text.
  • the text obtained by the conversion indicates the content of the target data, so this method can be said to be a method of generating a description of the target data.
  • Table-to-Text As a conventional technique for generating data descriptions, for example, a technique called Table-to-Text that automatically generates descriptions for data in a table format is known. If the target data is data in a table format, it is possible to generate a description using such a technique. However, with Table-to-Text, it is not possible to generate XML format data or knowledge graph descriptions. In Table-to-Text, it is necessary to perform supervised learning in advance using a combination of table-format data and its explanatory text as teacher data, and it is necessary to prepare a large amount of such teacher data. In this regard, this method does not require preparation of training data and no need for prior learning.
  • the text generated by this method can be used for various purposes.
  • text obtained by converting the target data can be used to determine a label to be assigned to the target data, in other words, to classify the target data.
  • Such label determination or classification can be performed using a label estimation model for estimating labels to be assigned to text.
  • a known text classification model such as a zero-shot text classifier may be applied as the label estimation model.
  • Zero-shot text classification is a technique for classifying into classes not included in learning data in text classification. For example, it is assumed that the text included in the learning data is labeled "entertainment” or "politics". At this time, the zero-shot text classification is to determine whether or not the text to be estimated is classified into the class "economy" that is not included in the learning data.
  • An example of a zero-shot text classifier is a method that uses a language understanding model built by learning whether or not a premise sentence entails a hypothesis sentence.
  • the text obtained by converting the target data may be used as the premise sentence, or the premise sentence may be generated from the text.
  • hypothetical sentences related to the candidates are generated from the candidate labels to be assigned to the target data, and input to the zero-shot text classifier together with the above premise sentences.
  • an output value indicating the degree to which the premise sentence entails the hypothesis sentence, that is, the compatibility between the target data and the label candidate is output.
  • a decision can be made whether to label the candidate.
  • the output values may be calculated for a plurality of label candidates, and candidates whose calculated output values are equal to or greater than a predetermined threshold value ⁇ may be estimated as labels to be assigned to the target data. Further, for example, the candidates having the highest calculated output values of ⁇ may be estimated as labels to be assigned to the target data.
  • Dl is one piece of data (for example, a CSV format table or an XML format file).
  • the method can be used to detect data in other formats (eg, files in XML format) that are similar to the tabular format data uploaded to the data lake D.
  • the present method converts the tabular data uploaded to the data lake D and each data Dl included in the data lake D into text. Then convert these texts into embedding vectors. If the text obtained by transforming the data D is represented by dD , and the transform into the embedding vector is performed by BERT, the generated embedding vector is represented as follows. Note that N is the number of dimensions of the embedding vector.
  • the uploaded table format data is data D
  • the XML format data contained in the data lake D is data D'
  • the cosine similarity of these data can be calculated using the embedding vector as cos(Bert( d D ), BERT(d D' )). Note that any method can be used to calculate the degree of similarity between embedding vectors, and the degree of similarity can be calculated using another method.
  • Data D can detect data similar to For example, among the data Dl included in the data lake D, the XML format file having the highest degree of similarity with the data D is expressed as follows.
  • a regression model or machine learning model (hereinafter simply referred to as a model) may be constructed using the text generated by this method.
  • a model built using text generated from one form of target data can also be applied to other forms of data.
  • FIG. 4 is a block diagram showing the configuration of the data conversion device 2.
  • the data conversion device 2 is a device for converting target data into text.
  • the data conversion device 2 also includes an input unit 22 for receiving a user's input operation to the data conversion device 2 and an output unit 23 for the data conversion device 2 to output data.
  • the data conversion device 2 may be a device dedicated to text conversion, or may be a general-purpose device that can be used for other purposes.
  • the control unit 20 also includes a data acquisition unit (data acquisition means) 201 and a data conversion unit (data conversion means) 202 .
  • the storage unit 21 stores target data 211 , semi-structured data template 212 , structured data template 213 , and text 215 .
  • the data acquisition unit 201 acquires semi-structured data or structured data as target data to be converted into text. In addition, the data acquisition unit 201 causes the storage unit 21 to store the acquired target data as the target data 211 .
  • the data conversion unit 202 converts the target data 211 into text.
  • the data conversion unit 202 also stores the text generated by the conversion in the storage unit 21 as the text 214 . Specifically, when the target data 211 is semi-structured data, the data conversion unit 202 converts the target data 211 into text using the semi-structured data template 212 . Further, when the target data 211 is structured data, the data conversion unit 202 converts the target data 211 into text using the structured data template 213 .
  • the data conversion unit 202 may convert only either semi-structured data or structured data into text. Further, the data conversion unit 202 may convert one of the semi-structured data and the structured data into text using a template, and convert the other into text using another method. As another method, for example, there is a method of converting using a conversion model constructed by learning correspondence between data in a certain format and text indicating the content of the data in that format. For example, if the target data 211 is data in a table format, the data conversion unit 202 may convert it into text by the above-described Table-to-Text.
  • the data conversion unit 202 may generate one text from one target data 211 using one semi-structured data template 212 , or may use a plurality of semi-structured data templates 212 to generate one text. A plurality of texts may be generated from one target data 211 .
  • the data conversion device 2 may also include a template generator that generates the semi-structured data template 212 and the structured data template 213 .
  • the data acquisition unit 201 acquires semi-structured data or structured data as the target data 211 to be converted into text, and the semi-structured a data conversion unit 202 that converts target data 211 into text using a semi-structured data template 212 for converting structured data into text or a structured data template 213 for converting structured data into text; , is adopted.
  • the semi-structured a data conversion unit 202 that converts target data 211 into text using a semi-structured data template 212 for converting structured data into text or a structured data template 213 for converting structured data into text;
  • FIG. 5 is a diagram showing an example of the structured data template 213 that is applied when the target data is structured data.
  • Structured data is data whose data structure is predetermined and can be handled by a relational database management system (RDBMS).
  • RDBMS relational database management system
  • data represented as a table defined by rows and columns, such as data in CSV format, is structured data.
  • the target data D shown in FIG. 5 includes four columns of row name, company name, number of people, and location, and each row shows information on the row name, company name, number of people, and location (that is, elements of each row).
  • structured data FIG. 5 shows structured data templates 1 to 3 as examples of the structured data template 213 for converting structured data of such a format into text.
  • the text obtained by transforming line e using template t is represented as t(e).
  • the data conversion unit 202 uses the structured data template 213 " ⁇ column name ⁇ ⁇ element ⁇ " in which the column name and the element are simply arranged instead of " ⁇ column name ⁇ is ⁇ element ⁇ ". may The data conversion unit 202 may also use a structured data template 213 in which wordings relating to column names and elements are different from those in the example of FIG. 5, such as " ⁇ column name ⁇ is related to ⁇ element ⁇ ".
  • the data conversion unit 202 does not necessarily need to convert all column names and elements included in the target data D into text.
  • the data conversion unit 202 may not convert an element that satisfies a predetermined condition into text.
  • Predetermined conditions include, for example, that the data is numerical data, that data contains missing values, and that the meaning of the data alone is unknown, such as identification numbers (IDentification) and symbols.
  • IDentification identification numbers
  • the elements that are numerical data are not converted to text, if the target data D is converted to text using the structured data template 3, the resulting text will be "The company name is Morino Bakery. The location is A prefecture.”
  • the generated text may or may not accurately represent the content of the target data.
  • the generated text may or may not accurately represent the content of the target data.
  • the column name is blank or is an identification number, it is empirically known that the content of the target data is more accurately represented by converting it into text using elements.
  • the data conversion unit 202 may generate a plurality of texts from one target data D.
  • the data conversion unit 202 may add the text generated from the metadata to the text generated from the target data. This will be described with reference to FIG. FIG. 6 is a diagram showing an example in which text generated from metadata is added to text generated from target data.
  • FIG. 6 shows target data in a table format including columns A to D and accompanying metadata.
  • the data conversion unit 202 can generate the text dd from the target data in the table format.
  • the data conversion unit 202 generates the text d D ′ from the metadata. If the metadata is structured data, the text d D ′ is generated by the structured data template 213 . For example, the “additional information” part of the metadata shown in FIG. -xx-xxxx.The author is Health Insurance Division.The web page is http://....”. Also, if all or part of the metadata is semi-structured data, it can be converted into text by the semi-structured data template 212 .
  • the data conversion unit 202 may generate the text ⁇ d D , d D ′ ⁇ by connecting the text d D and the text d D ′ generated as described above as the text corresponding to the target data. As a result, it becomes possible to generate a text that takes into account not only the target data but also the metadata.
  • FIG. 7 is a diagram showing an example of the structured data template 213 that is applied when a table connected by ER exists in the target data.
  • FIG. 7 shows target data D, which is a table containing three primary keys of row name, company name, number of people, and location, and three keys of company name, industry, and cook license, which are connected to the target data by ER. and the table containing the foreign key.
  • FIG. 7 also shows structured data templates 4 and 5 applicable to such target data D. As shown in FIG.
  • Structured data template 4 is a template that reads " ⁇ column name ⁇ is ⁇ element: primary key ⁇ and ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇ .” Note that the part “ ⁇ column name ⁇ is ⁇ element: primary key ⁇ ” is repeated for the number of primary keys. The same applies to the part " ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇ ”.
  • t(e 1 ) The company name is Bakery in the forest. The number of people is 10. The location is A prefecture. And the business type is confectionery manufacturing. I have a cook license.” is generated.
  • the structured data template 5 incorporates the text about the foreign key in the middle of the text about the primary key.
  • the structured data template 5 is a template that reads " ⁇ column name ⁇ is ⁇ element: primary key ⁇ and ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇ ".
  • ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇
  • ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇ ”
  • ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇ ” ,” if there are multiple foreign keys, " ⁇ column name: foreign key ⁇ is ⁇ element: foreign key ⁇ ” ,”.
  • t(e 1 ) “The company name is Mori no Bakery, the business type is confectionery manufacturing, and there is a cook license. is.” text is generated. Note that text generated from other primary keys (number of people and location) may be added to this text.
  • the data conversion unit 202 may generate a text reflecting the contents of the table.
  • the target data can be converted into text that takes into account the contents of the tables connected by ER.
  • the data conversion unit 202 converts the target data using the semi-structured data template 212 or the structured data template 213 to convert the related data. You can convert it to text. As a result, in addition to the effect of the data conversion apparatus 1 according to the exemplary embodiment 1, the effect of being able to convert the target data into text that also considers the related data is obtained.
  • the target data 211 may be semi-structured data.
  • Semi-structured data is intermediate data between structured data that is structured and unstructured data that is not structured at all. is determined data.
  • Semi-structured data cannot be represented in a table format like structured data, but semi-structured data has rules for representing data. For example, data in formats such as JSON, HTML, and XML are semi-structured data.
  • FIG. 8 is a diagram showing an example of a semi-structured data template 212 applied to semi-structured data having a hierarchical structure.
  • FIG. 8 shows target data D in JSON format.
  • a key key
  • its value value
  • data related to the key can be described as a nested structure (also called hierarchical structure or nest) in which the key in brackets ⁇ ⁇ is further attached with brackets ⁇ ⁇ .
  • the semi-structured data template 1 shown in FIG. 8 can be applied.
  • the semi-structured data template 1 is for generating text from semi-structured data having a hierarchical structure. Specifically, template 1 for semi-structured data states, " ⁇ key ⁇ is ⁇ value ⁇ . ⁇ key of nested object ⁇ of ⁇ key ⁇ is ⁇ nested object value ⁇ .” template. If the target data includes multiple pairs of key and value, the data conversion unit 202 converts each pair of key and value into text " ⁇ key ⁇ is ⁇ value ⁇ .” The same is true for nested objects.
  • Target data in HTML and XML formats can also be converted into text by a similar semi-structured data template 212 .
  • the data conversion unit 202 can convert target data in HTML or XML format into text using a semi-structured data template 212 such as “ ⁇ tag: tag ⁇ is ⁇ content: content ⁇ ”. It is possible.
  • ⁇ tag ⁇ may be converted into a predetermined character string according to a predetermined conversion rule. For example, assume that the target data includes tags ⁇ title>XX ⁇ title>. In this case, the data conversion unit 202 may convert the “title” part into a character string indicating the contents of the tag “title”. Then, the data conversion unit 202 inputs the character string into the ⁇ tag ⁇ part of the template " ⁇ tag ⁇ is ⁇ content ⁇ ", and replaces the " ⁇ title>XX ⁇ title>” part with " The title is ⁇ XX ⁇ .”
  • the target data is an HTML file including the following description.
  • the data conversion unit 202 converts the ⁇ label> tag into a character string "label” indicating the contents of the tag, and converts the template together with the character string "xxx voting district” described in this tag. to enter.
  • the data conversion unit 202 converts the ⁇ poolingPlace> tag into a character string "voting place” indicating the content of the tag, and converts it into the above template together with the character string "yyy center” described in this tag. input.
  • the data conversion unit 202 can generate the text "Label is xxx voting district. Voting place is yyy center.” from the above description in the HTML file.
  • the data conversion unit 202 converts the character string indicating the content of the tag and the character string described in the tag into a semi-structured data template.
  • the subject data may be converted to text by inputting at 212 .
  • the target data 211 may be semi-structured data in the form of a graph in which the relationships between multiple nodes are indicated by links.
  • Semi-structured data in a graph format can be converted into text by a semi-structured data template 2 shown in FIG. 9, for example.
  • FIG. 9 is a diagram showing an example of a semi-structured data template applied to graph-format semi-structured data.
  • FIG. 9 shows a knowledge graph, which is semi-structured data in graph form, and a template 2 for semi-structured data applicable to this.
  • a knowledge graph here refers to data that has a structure consisting of multiple nodes and links that connect the nodes. According to the knowledge graph, relationships between nodes can be represented by links. For example, in the knowledge graph shown in FIG. 9, three users of an SNS (Social Networking Service) and tweets posted by one of them are represented as nodes. Arrows or links connecting nodes indicate the relationship between users and the relationship between users and tweets. From this knowledge graph, a 25-year-old user named Alice is being followed by a 20-year-old user named Klaus, and tweeted "I'm in Tokyo now" on June 21, 20xx with a smartphone. You can read what you have posted.
  • SNS Social Networking Service
  • a semi-structured data template 2 such as the semi-structured data template 2 shown in FIG. 9, that converts the relationships between nodes into text may be applied.
  • the template for semi-structured data 2 is a template that states "There is a relationship between ⁇ node ⁇ and ⁇ edge ⁇ . ⁇ node ⁇ is ⁇ edge ⁇ by ⁇ intervening ⁇ .” "Intervention" is information accompanying the edge, and indicates the means that intervened in the action indicated by the edge.
  • this semi-structured data template 2 to convert the description about the user “Alice” included in the knowledge graph shown in FIG. .”
  • text is generated.
  • the character string in the ⁇ node ⁇ portion is the "name" indicated in that node.
  • the character string in the ⁇ node ⁇ portion may be a character string related to that node.
  • a conversion rule for converting a predetermined element (character string) included in the knowledge graph into a corresponding word (character string) may be used together. For example, assume that the information associated with the edge is ⁇ device:smartphone ⁇ instead of the above ⁇ intervention ⁇ .
  • a correspondence table such as ⁇ smartphone: smart phone, device: using ⁇ may be stored.
  • ⁇ smartphone smart phone
  • device: using ⁇ may be stored.
  • this correspondence table and, for example, the template " ⁇ node ⁇ ⁇ information associated with edge ⁇ ⁇ edge ⁇ " is used, it is possible to generate the text "A tweet was posted using a smartphone.” .
  • the data conversion unit 202 may set the ⁇ node ⁇ part to "user" as it is, and add text indicating information related to the node, as in the example of the ER shown in FIG. .
  • the data conversion unit 202 converts the part of the above text "I have a following relationship with Billy” into the text "I have a following relationship with a user whose name is Billy and whose age is 16.” good too.
  • information attached to nodes and links may also be converted to text.
  • the "tweet" node in the example of FIG. 9 is provided with text indicating the posted content and date information.
  • the data conversion unit 202 uses a smartphone to post a tweet, the content of which is 'I'm in Tokyo now', and the date is June 21, 20xx. You may generate text such as ”.
  • a semi-structured data template of " ⁇ node ⁇ and ⁇ edge ⁇ ” is used for the node on the end point side of the link arrow, and " ⁇ A template for semi-structured data with ⁇ edge ⁇ to node ⁇ may be used.
  • the application target of the semi-structured data template 2 as shown in FIG. 9 is not limited to the knowledge graph.
  • the friend graph of SNS can also be converted into text according to the same conversion rule.
  • the data conversion unit 202 converts a character string indicating the contents of a node and a character string indicating the contents of a link connecting to the node into into the semi-structured data template 212 to convert the target data into text.
  • the effect of making it possible to convert semi-structured data in graph format into text is obtained.
  • the data conversion unit 202 does not need to convert all the elements into text regardless of the format of the target data, and may sample some elements from the target data and convert them into text. For example, if the target data is a single table, the data conversion unit 202 may randomly sample some of the rows forming the target data and generate text from the sampled rows.
  • the data conversion unit 202 may sample rows that satisfy a predetermined condition such as no missing value. Furthermore, for example, the data conversion unit 202 may perform sampling according to the number of unique elements within a column.
  • a unique element refers to an element that does not have duplication in a certain column of table data. For example, assume that there are only 47 unique elements in the column "location" included in a table (target data) with 1000 rows. For example, if "place" is a column indicating prefectures in Japan, such a situation can occur. In this case, if no measures are taken, a text containing many duplicate prefectures will be generated.
  • the data conversion unit 202 may, after converting a line containing a certain "place” into text, not convert lines containing the same "place” into text, that is, may not sample. In addition, the data conversion unit 202 may perform sampling so that the line including "location" does not exceed a predetermined upper limit.
  • the data conversion unit 202 samples a portion of the multiple rows containing the same element. , you may convert the strings contained in the sampled lines to text. According to this configuration, in addition to the effect of the data conversion device 1 according to the first exemplary embodiment, the effect of being able to reduce the redundancy of the generated text can be obtained.
  • target data For example, suppose there are 1000 unique elements in a certain column in a 1000 row table (target data). For example, such a state can occur in columns indicating IDs, personal names, and the like. The ID and personal name alone have little explanatory power regarding the contents of the target data, and the necessity of including such information in the text is low.
  • the data conversion unit 202 calculates the ratio of the number of unique elements included in each column included in the structured data in the table format to the number of rows of the target data, that is, (number of unique elements)/( number of rows), and elements in columns whose value is greater than or equal to a threshold value may not be included in the text.
  • the effect of being able to reduce the redundancy of the generated text can be obtained.
  • FIG. 10 is a flowchart showing the flow of processing executed by the data conversion device 2. As shown in FIG.
  • the data acquisition unit 201 acquires the target data 211.
  • the target data 211 acquired in S21 may be input by the user of the data conversion device 2 via the input unit 22, for example. Assume here that the target data 211 is either semi-structured data or structured data.
  • the data acquisition unit 201 may also acquire a template used for conversion of the target data 211 , that is, the semi-structured data template 212 or the structured data template 213 .
  • the data conversion unit 202 determines whether the target data 211 input in S21 is semi-structured data, that is, whether the target data 211 is semi-structured data or structured data.
  • the determination method in S22 is arbitrary, and for example, the data conversion unit 202 may determine whether the target data 211 is semi-structured data or structured data from the extension of the target data 211 .
  • the data conversion unit 202 uses the semi-structured data template 212 to convert the target data 211 input in S21 into text.
  • the data conversion unit 202 also causes the storage unit 21 to store the text obtained by the conversion as the text 214, thereby ending the processing in FIG. Note that the data conversion unit 202 may output the text 214 to the output unit 23 or another device.
  • the process proceeds to S24.
  • the data conversion unit 202 uses the structured data template 213 to convert the target data 211 input in S21 into text.
  • the data conversion unit 202 may perform sampling as described in the section "Improved Sampling". The storage and output of the text obtained by converting the target data 211 are the same as in S23.
  • the appropriate semi-structured data template 212 may differ depending on the data format. Therefore, the semi-structured data template 212 is prepared for each data format. good too. The same is true for structured data.
  • the data conversion unit 202 determines the data format of the target data 211 and applies a template (semi-structured data template 212 or structured data template 213) according to the data format to perform conversion. You can do it.
  • the data conversion device 2 may also perform various types of processing as described in "Usage of Text Obtained by Conversion".
  • the data conversion device 2 may include label estimation means for estimating a label to be given to the text generated by converting the target data.
  • a zero-shot text classifier may also be used for label estimation.
  • the data conversion device 2 may include similarity calculation means for calculating the similarity between a plurality of texts generated by converting a plurality of target data. Further, the data conversion device 2 may include vector conversion means for converting text into an embedding vector in calculating the degree of similarity. Further, the data conversion device 2 may include similar data detection means for detecting similar data similar to the target data based on the calculated similarity.
  • an estimation system having the same functions as the data conversion device 2 can be constructed by using a plurality of devices that can communicate with each other. For example, by distributing the blocks shown in FIG. 4 to a plurality of devices, an estimation system having the same functions as the data conversion device 2 can be constructed.
  • the data conversion device 2 may be realized by hardware such as an integrated circuit (IC chip), or may be realized by software.
  • the data conversion device 2 is implemented by, for example, a computer that executes instructions of a program (estimation program) that is software that implements each function.
  • a program estimate program
  • FIG. 1 Computer C comprises at least one processor C1 and at least one memory C2.
  • a program P for operating the computer C as the data conversion device 2 is recorded in the memory C2.
  • the processor C1 reads the program P from the memory C2 and executes it, thereby implementing each function of the data conversion device 2 .
  • processor C1 for example, CPU (Central Processing Unit), GPU (Graphic Processing Unit), DSP (Digital Signal Processor), MPU (Micro Processing Unit), FPU (Floating point number Processing Unit), PPU (Physics Processing Unit) , a microcontroller, or a combination thereof.
  • memory C2 for example, a flash memory, HDD (Hard Disk Drive), SSD (Solid State Drive), or a combination thereof can be used.
  • the computer C may further include a RAM (Random Access Memory) for expanding the program P during execution and temporarily storing various data.
  • Computer C may further include a communication interface for sending and receiving data to and from other devices.
  • Computer C may further include an input/output interface for connecting input/output devices such as a keyboard, mouse, display, and printer.
  • the program P can be recorded on a non-temporary tangible recording medium M that is readable by the computer C.
  • a recording medium M for example, a tape, disk, card, semiconductor memory, programmable logic circuit, or the like can be used.
  • the computer C can acquire the program P via such a recording medium M.
  • the program P can be transmitted via a transmission medium.
  • a transmission medium for example, a communication network or broadcast waves can be used.
  • Computer C can also obtain program P via such a transmission medium.
  • the data conversion means converts the target data into text using the semi-structured data template when the target data is semi-structured data, and converts the target data into text when the target data is structured data
  • the data conversion device according to appendix 1, wherein the target data is converted into text using the structured data template.
  • the data conversion means converts the target data using the semi-structured data template or the structured data template. 3.
  • the data conversion device according to appendix 1 or 2 which converts to text including the obtained character string.
  • the data conversion means indicates character strings indicating the contents of nodes and the contents of links connecting to the nodes. 5.
  • the data conversion device according to any one of Appendices 1 to 4, wherein the target data is converted into text by inputting a character string into the semi-structured data template.
  • the data conversion means samples a portion of a plurality of lines containing the same element, and converts the character strings contained in the sampled lines into text. 6.
  • the data conversion device according to any one of Appendices 1 to 5.
  • the data conversion means converts the number of unique elements included in the columns included in the target data to the number of rows of the target data. 7. The data conversion device according to any one of Appendices 1 to 6, wherein the target data is converted into text without including elements of a column in which is equal to or greater than a threshold.
  • At least one processor obtains semi-structured data or structured data as target data to be converted to text, and a semi-structured data template or structure for converting the semi-structured data to text. converting the target data into text using a structured data template for converting structured data into text.
  • (Appendix 9) Data acquisition means for acquiring semi-structured data or structured data as target data to be converted into text, and semi-structured data template or structured data for converting semi-structured data into text
  • a data conversion program functioning as data conversion means for converting the target data into text by using a structured data template for converting data into text.
  • At least one processor performs data acquisition processing for acquiring semi-structured data or structured data as target data to be converted to text, and semi-structured data for converting semi-structured data to text.
  • a data conversion apparatus for executing a data conversion process of converting the target data into text using a structured data template or a structured data template for converting the structured data into text.
  • the data conversion device may further include a memory, and the memory may store a program for causing the processor to execute the data acquisition process and the data conversion process. Also, this program may be recorded in a computer-readable non-temporary tangible recording medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

変換の対象となる対象データの内容や性質等を把握することなく、当該対象データを扱いやすい形式に変換することを可能にするために、データ変換装置(1)は、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得部(11)と、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換部(12)と、を備える。

Description

データ変換装置、データ変換方法、およびデータ変換プログラム
 データの形式を変換するデータ変換装置等に関する。
 近時では、様々な内容のデータが大量に収集され、データレイク等に蓄積されるようになっている。一般に、データレイク等に蓄積されるデータには様々な形式のものが混在しており、このことが蓄積されたデータの利活用を妨げる要因の一つとなっている。
 このような観点から、様々な形式のデータを一括して取り扱うための技術の開発が進められている。例えば、下記の特許文献1には、データレイクに記憶されている様々な形式のデータを予測モデル作成向けのデータに変換して予測モデルを作成することが記載されている。また、特許文献1には、その予測モデルを用いた予測における各データの寄与度を求めることにより、各データの価値を定めることが記載されている。
 また、データレイク等に記憶されている様々な形式のデータを活用するための技術としては、下記の特許文献2や非特許文献1のような技術も存在する。特許文献2には、表の意味を推定する技術が開示されており、非特許文献1には画像の分類クラスを推定する技術が開示されている。これらの技術を用いれば、画像やテーブルが混在するデータレイクにおいて、タグという共通の枠組みを使ってデータを扱うことが可能になる。つまり、データレイクに含まれるテーブルすなわち表については特許文献2の技術を用いてその意味を推定し、推定した意味を示すタグを付与することができる。同様に、データレイクに含まれる画像については非特許文献1の技術を用いて分類クラスを推定し、推定した分類クラスを示すタグを付与することができる。
特開2021-140296号 国際公開第2019/171537号
Yongqin Xian, Christoph H. Lampert, Bernt Schiele, and Zeynep Akata, "Zero-Shot Learning - A Comprehensive Evaluation of the Good, the Bad and the Ugly", IEEE Trans. Pattern Anal. Mach. Intell. 41(9):2251-2265 (2019)
 特許文献1の技術では、データを予測モデル作成向けのデータに変換する際に、材料組成の情報から特徴量ベクトルを生成する処理が行われる。このような処理を行うためには、価値評価の対象となるデータが、材料組成の情報を含んでいる必要がある。しかしながら、データレイクに記憶されているデータには、材料組成の情報を含んでいるものもあれば、材料組成の情報を含んでいないものもある。このため、特許文献1の技術を適用する場合、価値評価の対象となる各データの内容や性質等を確認し、材料組成の情報を含むデータを抽出するという手間を要する。
 また、特許文献2の技術は表を対象としたものであり、表以外の形式のデータについてはその意味を推定することができない。また、非特許文献1の技術は画像を対象としたものであり、画像以外のデータについて分類クラスを推定するためには、そのようなデータについて機械学習を行って新たな分類モデルを生成する必要がある。このように、データレイクに記憶されているデータのような様々な形式のデータを一括して取り扱うのは容易ではなく、対象となるデータの形式の確認や、その形式に応じた変換を行ったり、分類モデルを用意したりする必要が生じる。
 本発明の一態様は、このような問題に鑑みてなされたものであり、その目的の一例は、変換の対象となる対象データの内容や性質等を把握することなく、当該対象データをテキストに変換することが可能な技術を提供することにある。
 本発明の一側面に係るデータ変換装置は、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段と、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換手段と、を備える。
 本発明の一側面に係るデータ変換方法は、少なくとも1つのプロセッサが、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得することと、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換することと、を含む。
 本発明の一側面に係るデータ変換プログラムは、コンピュータを、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段、および半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換手段、として機能させる。
 本発明の一態様によれば、変換の対象となる対象データの内容や性質等を把握することなく、当該対象データをテキストに変換することが可能になる。
本発明の例示的実施形態1に係るデータ変換装置の構成を示すブロック図である。 本発明の例示的実施形態1に係るデータ変換方法の流れを示すフロー図である。 様々な形式の対象データをテキストに変換した例を示す図である。 本発明の例示的実施形態2に係るデータ変換装置の構成を示すブロック図である。 対象データが構造化データである場合に適用する構造化データ用テンプレートの例を示す図である。 対象データから生成したテキストに、メタデータから生成したテキストを追加した例を示す図である。 対象データにERで繋がったテーブルが存在する場合に適用される構造化データ用テンプレートの例を示す図である。 階層構造を有する半構造化データに適用する半構造化データ用テンプレートの例を示す図である。 グラフ形式の半構造化データに適用する半構造化データ用テンプレートの例を示す図である。 上記データ変換装置が実行する処理の流れを示すフロー図である。 本発明の各例示的実施形態に係る各装置の各機能を実現するソフトウェアであるプログラムの命令を実行するコンピュータの一例を示す図である。
 〔例示的実施形態1〕
 本発明の第1の例示的実施形態について、図面を参照して詳細に説明する。本例示的実施形態は、後述する例示的実施形態の基本となる形態である。
 (データ変換装置の構成)
 本例示的実施形態に係るデータ変換装置1の構成について、図1を参照して説明する。図1は、データ変換装置1の構成を示すブロック図である。図1に示すように、データ変換装置1は、データ取得部11とデータ変換部12とを備えている。
 データ取得部11は、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得する。
 データ変換部12は、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、上記対象データをテキストに変換する。
 以上のように、本例示的実施形態に係るデータ変換装置1においては、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得部(11)と、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、上記対象データをテキストに変換するデータ変換部(12)と、を備える、という構成が採用されている。この構成によれば、対象データの内容や性質等を把握することなく、当該対象データをテキストに変換することが可能になるという効果が得られる。
 (データ変換プログラム)
 上述のデータ変換装置1の機能は、プログラムによって実現することもできる。本例示的実施形態に係るデータ変換プログラムは、コンピュータを、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段、および半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、上記対象データをテキストに変換するデータ変換手段、として機能させる。このデータ変換プログラムによれば、対象データの内容や性質等を把握することなく、当該対象データをテキストに変換することが可能になるという効果が得られる。
 (データ変換方法の流れ)
 本例示的実施形態に係るデータ変換方法の流れについて、図2を参照して説明する。図2は、データ変換方法の流れを示すフロー図である。なお、このデータ変換方法における各ステップの実行主体は、データ変換装置1が備えるプロセッサであってもよいし、他の装置が備えるプロセッサであってもよく、各ステップの実行主体がそれぞれ異なる装置に設けられたプロセッサであってもよい。
 S11では、少なくとも1つのプロセッサが、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得する。
 S12では、少なくとも1つのプロセッサが、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、上記対象データをテキストに変換する。
 以上のように、本例示的実施形態に係るデータ変換方法は、少なくとも1つのプロセッサが、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得することと、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、上記対象データをテキストに変換することと、を含む。このデータ変換方法によれば、対象データの内容や性質等を把握することなく、当該対象データをテキストに変換することが可能になるという効果が得られる。
 〔例示的実施形態2〕
 本発明の第2の例示的実施形態について、図面を参照して詳細に説明する。
 (推定方法の概要)
 本例示的実施形態に係るデータ変換方法(以下、本方法と呼ぶ)の概要を図3に基づいて説明する。図3は、様々な形式の対象データをテキストに変換した例を示す図である。具体的には、図3には、テキストに変換する対象となる対象データの例として、CSV(Comma Separated Values)形式の対象データD、XML(eXtensible Markup Language)形式の対象データD’、および知識グラフである対象データD’’の3つを記載している。なお、知識グラフは、複数のノード間の関係がリンクにより示されたグラフ形式のデータである。
 本方法では、このような様々な形式の対象データを、所定のテンプレートによりテキストに変換する。テキストへの変換に用いるテンプレートは、対象データに含まれる要素からテキストを生成できるものであればよい。テキストへの変換に用いるテンプレートは、対象データに含まれるどのような要素をどのように配置してテキスト化するかを示す変換規則であるともいえる。
 詳細は後述するが、テキストへの変換に用いるテンプレートは、例えば、対象データに含まれる文字列を組み込めるように構成されたものであって、当該テンプレートに対象データに含まれる文字列を組み込むことにより対象データをテキストに変換するものであってもよい。また、対象データをテキストに変換する際には、対象データの所定の要素を所定の文字列に置き換える変換を行ってもよい。
 この変換により得られたテキストは、対象データの内容を示すものとなる。図3の例では、対象データDはd=“xxxxx”というテキストに変換されている。同様に、D’はdD’=“yyyy”というテキストに変換されており、D’’はdD’’=“zzzzz”というテキストに変換されている。
 このように、本方法ではテンプレートを用いて対象データを変換するため、対象データの性質や内容を把握するための解析や確認を行うことなく、様々な形式の対象データをテキストという扱いやすい単一の形式に変換することができる。また、上記のように、変換により得られたテキストは、対象データの内容を示すものとなるから、本方法は、対象データの説明文の生成方法であるともいえる。
 なお、データの説明文を生成する従来技術としては、例えばテーブル形式のデータの説明文を自動で生成するTable-to-Textという技術が知られている。対象データがテーブル形式のデータであれば、このような技術を用いて説明文を生成することも可能である。ただし、Table-to-Textでは、XML形式のデータや知識グラフの説明文を生成することはできない。また、Table-to-Textでは、テーブル形式のデータとその説明文の組み合わせを教師データとした教師あり学習を事前に行う必要があり、そのような教師データを大量に用意する必要がある。この点、本方法では教師データを用意する必要もなく、事前に学習を行う必要もない。
 (変換により得られたテキストの利用について)
 本方法により生成されたテキストは様々な用途で利用することができる。例えば、対象データの代わりに当該対象データを変換したテキストを用いて、対象データに付与するラベルを決定すること、言い換えれば対象データを分類することもできる。このようなラベルの決定あるいは分類は、テキストに付与すべきラベルを推定するためのラベル推定モデルを用いて行うことができる。また、ラベル推定モデルとして、ゼロショットテキスト分類器等の公知のテキスト分類モデルを適用してもよい。
 ここで、ゼロショットテキスト分類器について説明する。ゼロショットテキスト分類とは、テキスト分類において、学習データに含まれないクラスへの分類を行う技術である。たとえば、学習データに含まれるテキストに対して「芸能」または「政治」というラベルが付与されていたと仮定する。この時、推定対象のテキストが、学習データに含まれない「経済」というクラスへ分類されるか否かを判定することがゼロショットテキスト分類である。
 ゼロショットテキスト分類器の一例としては、前提文が仮説文を含意するか否かを学習することにより構築された言語理解モデルを用いる方法がある。このようなゼロショットテキスト分類器を用いる場合、対象データを変換したテキストを前提文とするか、当該テキストから前提文を生成すればよい。そして、対象データに付与するラベルの候補から当該候補に関連する仮定文を生成し、上記の前提文と共にゼロショットテキスト分類器に入力すればよい。これにより、前提文が仮説文を含意する程度、すなわち対象データとラベルの候補との適合性を示す出力値が出力されるので、その出力値と閾値を比較する等の処理により対象データに当該候補のラベルを付与するか否かを決定することができる。例えば、複数のラベルの候補について上記出力値を算出し、算出された出力値が所定の閾値θ以上の候補を、当該対象データに付与すべきラベルと推定してもよい。また、例えば、算出された出力値が上位θ個の候補を、当該対象データに付与すべきラベルと推定してもよい。
 このように、本方法により生成したテキストを用いることにより、それぞれ形式の異なる複数の対象データについて、同一の基準で(つまり同一のゼロショットテキスト分類器を用いて)ラベルを付与することができる。例えば、CSV形式の対象データD、XML形式の対象データD’、および知識グラフである対象データD’’について、1つのゼロショットテキスト分類器を用いて、それらに付与すべきラベルを推定することもできる。
 また、BERT(Bidirectional Encoder Representations from Transformers)等の公知の言語モデルを用いれば、テキストをその特徴を示す埋め込みベクトルに変換することができる。そして、この変換により得られる埋め込みベクトルを用いれば、テキスト間の類似度すなわち対象データ間の類似度を算出することもできる。これにより、例えばCSV形式の対象データD、XML形式の対象データD’、および知識グラフである対象データD’’のように、それぞれ形式の異なる複数の対象データ間の類似度を算出することもできる。
 これにより、例えば形式の異なる複数のデータを含むデータ群の中から類似したデータを検出することも可能になる。例えば、企業Aが、様々なデータが格納されたデータレイクD={D|l=1,…,n}を保有していたとする。なお、Dは1つのデータ(例えばCSV形式のテーブルやXML形式のファイル)である。以下説明するように、本方法を用いれば、データレイクDにアップロードしたテーブル形式のデータに類似した他の形式のデータ(例えばXML形式のファイル)を検出することができる。
 この場合、本方法より、データレイクDにアップロードしたテーブル形式のデータと、データレイクDに含まれる各データDとをテキストに変換する。そして、これらのテキストを埋め込みベクトルに変換する。データDを変換したテキストをdと表し、埋め込みベクトルへの変換をBERTで行う場合、生成される埋め込みベクトルは下記のように表される。なお、Nは、埋め込みベクトルの次元数である。
Figure JPOXMLDOC01-appb-M000001
 ここで、アップロードしたテーブル形式のデータをデータD、データレイクDに含まれるXML形式のデータをデータD’とすれば、これらのデータのコサイン類似度は上記の埋め込みベクトルを用いてcos(Bert(dD), BERT(dD'))と表される。なお、埋め込みベクトル間の類似度の算出方法は任意であり、他の手法で類似度を算出してもよい。
 埋め込みベクトルを用いて算出した上記の類似度(具体的にはコサイン類似度)を、データDとデータD’の類似度とみなすことにより、データレイクDに含まれるデータDの中からデータDに類似したデータを検出することができる。例えば、データレイクDに含まれるデータDのうち、データDとの類似度が最も高いXML形式のファイルは、下記のように表される。
Figure JPOXMLDOC01-appb-M000002
 また、本方法により生成されたテキストを用いて回帰モデルや機械学習モデル(以下、単にモデルと呼ぶ)を構築してもよい。ある形式の対象データから生成されたテキストを用いて構築したモデルは、他の形式のデータにも適用可能である。
 例えば、それぞれのデータとしての価値が既知のCSV形式のファイルが複数あったとする。この場合、それらのファイルを本方法でテキストに変換し、そのテキストをさらに埋め込みベクトルに変換すれば、ファイルの価値と埋め込みベクトルとの相関を示す回帰モデルを構築することができる。この回帰モデルに、XML形式のファイルを本方法で変換したテキストから生成された埋め込みベクトルを入力すれば、そのXML形式のファイルの価値の推定値を出力させることができる。JSON(JavaScript Object Notation:登録商標)等の他の形式のファイルについても同様である。
 近年では、上述したBERTやGPT-3(Generative Pre-trained Transformer-3)のような高性能な言語処理モデルが利用可能になっている。本法は、このようなモデルに入力するテキストの生成に好適に利用できる。
 (データ変換装置の構成)
 本例示的実施形態に係るデータ変換装置2の構成を図4に基づいて説明する。図4は、データ変換装置2の構成を示すブロック図である。データ変換装置2は、対象データをテキストに変換する装置であり、図示のように、データ変換装置2の各部を統括して制御する制御部20と、データ変換装置2が使用する各種データを記憶する記憶装置である記憶部21を備えている。また、データ変換装置2は、データ変換装置2に対するユーザの入力操作を受け付ける入力部22と、データ変換装置2がデータを出力するための出力部23を備えている。なお、データ変換装置2は、テキスト変換専用の装置であってもよいし、他の用途にも使用できる汎用的な装置であってもよい。
 また、制御部20には、データ取得部(データ取得手段)201およびデータ変換部(データ変換手段)202が含まれている。そして、記憶部21には、対象データ211、半構造化データ用テンプレート212、構造化データ用テンプレート213、およびテキスト215が記憶されている。
 データ取得部201は、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得する。また、データ取得部201は、取得した対象データを対象データ211として記憶部21に記憶させる。
 データ変換部202は、対象データ211をテキストに変換する。また、データ変換部202は、変換により生成されたテキストをテキスト214として記憶部21に記憶させる。具体的には、データ変換部202は、対象データ211が半構造化データである場合には半構造化データ用テンプレート212を用いて対象データ211をテキストに変換する。また、データ変換部202は、対象データ211が構造化データである場合には構造化データ用テンプレート213を用いて対象データ211をテキストに変換する。
 この構成によれば、例示的実施形態1に係るデータ変換装置1の奏する効果に加えて、対象データ211が半構造化データおよび構造化データの何れであってもテキストに変換することが可能になるという効果が得られる。なお、半構造化データ用テンプレート212および構造化データ用テンプレート213の詳細は図5~図9に基づいて後述する。
 無論、データ変換部202は、半構造化データおよび構造化データの何れかについてのみテキストに変換するものであってもよい。また、データ変換部202は、半構造化データおよび構造化データの一方はテンプレートを用いてテキストに変換し、他方は他の手法を用いてテキストに変換するものであってもよい。他の手法としては、例えば、ある形式のデータと当該形式のデータの内容を示すテキストとの対応関係を学習することにより構築された変換モデルを用いて変換する方法が挙げられる。例えば、データ変換部202は、対象データ211がテーブル形式のデータであれば、上述したTable-to-Textによりテキストに変換してもよい。
 なお、データ変換部202は、1つの半構造化データ用テンプレート212を用いて1つの対象データ211から1つのテキストを生成してもよいし、複数の半構造化データ用テンプレート212を用いて1つの対象データ211から複数のテキストを生成してもよい。また、データ変換装置2は、半構造化データ用テンプレート212および構造化データ用テンプレート213を生成するテンプレート生成部を備えていてもよい。
 以上のように、本例示的実施形態に係るデータ変換装置2においては、半構造化データまたは構造化データを、テキストに変換する対象となる対象データ211として取得するデータ取得部201と、半構造化データをテキストに変換するための半構造化データ用テンプレート212または構造化データをテキストに変換するための構造化データ用テンプレート213を用いて、対象データ211をテキストに変換するデータ変換部202と、を備える、という構成が採用されている。この構成によれば、対象データの内容や性質等を把握することなく、当該対象データをテキストに変換することが可能になるという効果が得られる。
 (構造化データ用テンプレートの例)
 図5は、対象データが構造化データである場合に適用する構造化データ用テンプレート213の例を示す図である。構造化データとは、データの構造が予め決まっているデータであり、関係データベース管理システム(RDBMS:Relational Data Base Management System)で扱うことができるデータである。例えば、CSV形式のデータのように、行と列で定義されたテーブルとして表されるデータは構造化データである。
 図5に示す対象データDは、行名、会社名、人数、および場所の4つの列を含み、各行に行名、会社名、人数、および場所の情報(すなわち各行の要素)がそれぞれ示された構造化データである。図5には、このような形式の構造化データをテキストに変換する構造化データ用テンプレート213の例として、構造化データ用テンプレート1~3を示している。
 構造化データ用テンプレート1は、対象データの列名を繋げてテキストにするテンプレートであり、t=“{列名}…{列名}”と表される。ここでは、行eをテンプレートtにより変換したテキストをt(e)と表す。図5に示すように、構造化データ用テンプレート1を用いることにより、対象データDからt(e)=“会社名 人数 場所”というテキストが生成される。
 構造化データ用テンプレート2は、各行の要素を繋げてテキストにするテンプレートであり、t=“{要素}…{要素}”と表される。ただし各要素は同じ行に含まれる要素である。図5に示すように、構造化データ用テンプレート2を用いることにより、対象データDからt(e)=“森のパン屋 10 A県”というテキストが生成される。また、行名e以降についても同様にしてテキストを生成することができる。このようにして生成したテキストを繋ぎ合わせれば、1つの対象データDから1つのテキストd=“t(e)t(e)…”が生成される。
 構造化データ用テンプレート3は、“{列名}は{要素}です。”というテンプレートである。図5に示すように、構造化データ用テンプレート3を用いることにより、対象データDからt(e)=“会社名は森のパン屋です。人数は10です。場所はA県です。”というテキストが生成される。また、行名e以降についても同様にしてテキストを生成することができる。
 また、データ変換部202は、“{列名}は{要素}です。”の代わりに、単に列名と要素を並べた“{列名}{要素}”という構造化データ用テンプレート213を用いてもよい。また、データ変換部202は、“{列名}は{要素}に関する。”のように列名と要素に関する文言が図5の例とは異なる構造化データ用テンプレート213を用いてもよい。
 なお、データ変換部202は、必ずしも対象データDに含まれる全ての列名および要素をテキスト化する必要はない。例えば、データ変換部202は、所定の条件を満たす要素はテキスト化しないようにしてもよい。所定の条件としては、例えば、数値データであること、欠損値を含むこと、識別番号(ID:IDentification)や記号のようにそれ単体では意味が不明なものであること、等が挙げられる。数値データである要素をテキスト化しない場合、対象データDを構造化データ用テンプレート3でテキスト化すると、得られるテキストは“会社名は森のパン屋です。場所はA県です。”となる。
 また、対象データと構造化データ用テンプレート213の組み合わせや、変換の対象とした列や要素に応じて、生成されるテキストが対象データの内容を的確に表したものとなることも、そうならないこともある。例えば、数値のみの要素についてはテキスト化しても対象データの内容を的確に表したものとはならないことが多いことが経験的に分かっている。また、例えば、列名が空欄であったり、識別番号であったりする場合は、要素でテキスト化する方が対象データの内容を的確に表したものとなることが多いことが経験的に分かっている。
 このため、データ変換部202は、1つの対象データDから複数のテキストを生成してもよい。例えば、データ変換部202は、構造化データ用テンプレート1を用いてテキストd =“会社名 人数 場所”を生成すると共に、構造化データ用テンプレート3を用いてテキストd =“会社名は森のパン屋です。人数は10です。場所はA県です。”を生成してもよい。
 (メタデータの活用)
 対象データにその対象データに関連するメタデータが付随している場合、データ変換部202は、対象データから生成したテキストに、メタデータから生成したテキストを追加してもよい。これについて図6に基づいて説明する。図6は、対象データから生成したテキストに、メタデータから生成したテキストを追加した例を示す図である。
 図6には、A~Dの列を含むテーブル形式の対象データと、これに付随するメタデータを示している。データ変換部202は、上述のような構造化データ用テンプレート213を用いることにより、テーブル形式の対象データからテキストdを生成することができる。
 また、データ変換部202は、メタデータからテキストd’を生成する。メタデータが構造化データであれば、構造化データ用テンプレート213によりテキストd’を生成する。例えば、図6に示すメタデータの「追加情報」の部分は、“{列名}は、{要素}です。”という構造化データ用テンプレート213により、“組織はD市です。連絡先はxxxx-xx-xxxxです。作成者は健康保険課です。ウェブページはhttp://…です。”のようなテキストに変換することができる。また、メタデータの全部または一部が半構造化データであれば半構造化データ用テンプレート212によりテキストに変換することができる。
 そして、データ変換部202は、上記のようにして生成したテキストdとテキストd’を繋ぎ合わせたテキスト{d,d’}を、対象データに対応するテキストとして生成すればよい。これにより、対象データのみではなく、メタデータについても加味したテキストを生成することが可能になる。
 (ERで繋がったテーブルが存在する場合の変換の例)
 対象データにER(Entity Relationship)で繋がったテーブルが存在する場合の変換の例について図7に基づいて説明する。図7は、対象データにERで繋がったテーブルが存在する場合に適用される構造化データ用テンプレート213の例を示す図である。
 図7には、行名、会社名、人数、および場所という3つの主キーを含むテーブルである対象データDと、対象データにERで繋がった、会社名、業種、および調理師免許という3つの外部キーを含むテーブルとを示している。また、図7には、このような対象データDに適用可能な構造化データ用テンプレート4および5を示している。
 構造化データ用テンプレート4は、“{列名}は{要素:主キー}です。そして、{列名:外部キー}は{要素:外部キー}です。”というテンプレートである。なお、「{列名}は{要素:主キー}です。」の部分は主キーの数だけ繰り返す。「{列名:外部キー}は{要素:外部キー}です。」の部分も同様である。
 この構造化データ用テンプレート4をeの行に適用することにより、図示のように、t(e)=“会社名は森のパン屋です。人数は10です。場所はA県です。そして、業種は菓子製造です。調理師免許はありです。”とのテキストが生成される。
 構造化データ用テンプレート5は、主キーに関するテキストの途中に外部キーに関するテキストを組み込むものである。具体的には、構造化データ用テンプレート5は、“{列名}は{要素:主キー}で、{列名:外部キー}は{要素:外部キー}です。”というテンプレートである。なお、「{列名:外部キー}は{要素:外部キー}です。」の部分について、外部キーが複数存在する場合には、「{列名:外部キー}は{要素:外部キー}で、」の形で列挙する。
 この構造化データ用テンプレート5をeの行に適用することにより、図示のように、t(e)=“会社名は森のパン屋で、業種は菓子製造で、調理師免許はありです。”とのテキストが生成される。なお、このテキストに、他の主キー(人数と場所)から生成したテキストを追加してもよい。
 以上のように、データ変換部202は、対象データにERで繋がったテーブルが存在する場合には、そのテーブルの内容についても反映したテキストを生成してもよい。これにより、対象データを、ERで繋がったテーブルの内容を加味したテキストに変換することができる。
 図6および図7に基づいて説明したように、対象データにERで繋がるテーブルや、メタデータ等のような、対象データに関連する関連データを利用できる場合がある。このような関連データを利用できる場合、データ変換部202は、対象データを、関連データを半構造化データ用テンプレート212または構造化データ用テンプレート213を用いて変換することにより得られる文字列を含むテキストに変換してもよい。これにより、例示的実施形態1に係るデータ変換装置1の奏する効果に加えて、対象データを、関連データについても加味したテキストに変換することができるという効果が得られる。
 (階層構造を有する半構造化データに適用する半構造化データ用テンプレートの例)
 対象データ211は半構造化データであってもよい。半構造化データとは、構造化されている構造化データと全く構造化されていない非構造化データとの中間的なデータであり、データの構造が完全には決まっていないが、ある程度の構造が決まっているデータである。半構造化データは、構造化データのようにテーブル形式で表現することはできないが、半構造化データには、データを表現するための規則が備わっている。例えば、JSON、HTML、XML等の形式のデータは半構造化データである。
 JSON形式等の階層構造を有する半構造化データについては、例えば図8に示すような半構造化データ用テンプレート212によりテキストに変換することができる。図8は、階層構造を有する半構造化データに適用する半構造化データ用テンプレート212の例を示す図である。図8には、JSON形式の対象データDを示している。JSON形式では、括弧{}内にキー(key)とその値(value)が記述される。また、括弧{}内のキーについてさらに括弧{}を付した入れ子構造(階層構造あるいはネストとも呼ばれる)として、そのキーに関するデータを記述することができる。
 このような対象データDについては、図8に示す半構造化データ用テンプレート1が適用可能である。半構造化データ用テンプレート1は、階層構造を有する半構造化データからテキストを生成するためのものである。具体的には、半構造化データ用テンプレート1は、“{key}は{value}です。{key}の{入れ子になっているオブジェクトのkey}は、{入れ子になっているオブジェクトvalue}です。”というテンプレートである。なお、対象データにkeyとvalueが複数組含まれている場合には、データ変換部202は、keyとvalueの各組を“{key}は{value}です。”というテキストに変換する。入れ子になっているオブジェクトについても同様である。
 この半構造化データ用テンプレート1を用いて図8に示す対象データDに含まれる“aaa”に関する記述を変換すると、t(aaa)=“職業は社長です。副業はないです。扶養はあります。扶養者の年齢は20で、職業は学生です。”とのテキストが生成される。
 なお、このテキストにおいては、対象データDにおける「False」は「ない」に、「True」は「あり」に変換している。このように、「False」や「True」等のbool値は適切な単語への置き換えを行うことが好ましい。また、上記テキストにおいては、入れ子になっている2つのオブジェクト(「扶養者」に関するもの)に対応するテキストを、「で」との接続語で繋いで一文にしている。このように、より文章として解釈しやすいテキストとするための変換を併用してもよい。このような変換規則、すなわち対象データに含まれる所定の要素(文字列)をそれに対応する単語(文字列)に変換する変換規則は、例えば要素と単語とを対応付けたテーブル等の形式で記憶部21等に記憶させておけばよい。例えば、上述の置き換えであれば、{True:ある、False:ない}のような対応表を記憶させておけばよい。
 また、HTML形式やXML形式の対象データについても同様の半構造化データ用テンプレート212によりテキストに変換することができる。例えば、データ変換部202は、“{タグ:tag}は{コンテンツ:content}です。”のような半構造化データ用テンプレート212により、HTML形式やXML形式の対象データをテキストに変換することが可能である。
 また、{タグ}を予め定めた変換規則により所定の文字列に変換してもよい。例えば、対象データに<title>XX<title>というタグが含まれているとする。この場合、データ変換部202は、「title」の部分を「タイトル」という当該タグの内容を示す文字列に変換してもよい。そして、データ変換部202は、“{タグ}は{コンテンツ}です。”とのテンプレートの{タグ}の部分に当該文字列を入力し、「<title>XX<title>」の部分を、“タイトルは{XX}です。”とのテキストに変換してもよい。
 また、例えば、対象データが下記のような記述を含むHTMLファイルであったとする。
<label>xxx投票区</label>
<poolingPlace>yyyセンター</ poolingPlace>
 この場合、データ変換部202は、<label>というタグについてはそのタグの内容を示す「ラベル」という文字列に変換し、このタグに記述された「xxx投票区」との文字列と共に上記テンプレートに入力する。また、データ変換部202は、<poolingPlace>というタグについてはそのタグの内容を示す「投票場所」という文字列に変換し、このタグに記述された「yyyセンター」との文字列と共に上記テンプレートに入力する。これにより、データ変換部202は、HTMLファイルの上記の記述から“ラベルはxxx投票区。投票場所はyyyセンター。”というテキストを生成することができる。
 このように、データ変換部202は、対象データ211が、タグを含む半構造化データである場合、タグの内容を示す文字列と当該タグに記述された文字列とを半構造化データ用テンプレート212に入力することにより対象データをテキストに変換してもよい。これにより、例示的実施形態1に係るデータ変換装置1の奏する効果に加えて、タグを含む半構造化データから可読性の高いテキストを生成することができるという効果が得られる。
 (グラフ形式の半構造化データに適用する半構造化データ用テンプレートの例)
 対象データ211は、複数のノード間の関係がリンクにより示されたグラフ形式の半構造化データであってもよい。グラフ形式の半構造化データについては、例えば図9に示す半構造化データ用テンプレート2によりテキストに変換することができる。図9は、グラフ形式の半構造化データに適用する半構造化データ用テンプレートの例を示す図である。図9にはグラフ形式の半構造化データである知識グラフと、これに適用可能な半構造化データ用テンプレート2を示している。
 ここでいう知識グラフとは、複数のノードと、ノード間を結ぶリンクとからなる構造を有するデータのことを指す。知識グラフによれば、ノード間の関係性をリンクにより表すことができる。例えば、図9に示す知識グラフでは、SNS(Social Networking Service)の3人のユーザと、その一人が投稿したつぶやきがノードとして表されている。また、各ノードを結ぶ矢印すなわちリンクが、ユーザ間の関係とユーザとつぶやきとの関係を示している。この知識グラフから、アリスという名前の25歳のユーザは、クラウスという名前の20歳のユーザからフォローされていることや、「今東京にいます」というつぶやきを20xx年6月21日にスマートフォンで投稿したこと等が読み取れる。
 対象データが知識グラフである場合、図9に示す半構造化データ用テンプレート2のような、ノード間の関係性をテキストにする半構造化データ用テンプレート2を適用してもよい。具体的には、半構造化データ用テンプレート2は、“{ノード}と{エッジ}の関係にある。{ノード}を{介在}で{エッジ}した。”というテンプレートである。なお、「介在」とはエッジに付随する情報であり、エッジに示される行為に介在した手段を示す。
 この半構造化データ用テンプレート2を用いて図9に示す知識グラフに含まれるユーザ「アリス」に関する記述を変換すると、t(アリス)=“ビリーとフォローの関係にある。つぶやきをスマートフォンで投稿した。”とのテキストが生成される。なお、この例では、{ノード}の部分の文字列をそのノードに示されている「名前」としている。このように、知識グラフをテキストに変換する場合には、{ノード}の部分の文字列を、そのノードに関連する文字列としてもよい。
 また、知識グラフをテキストに変換する場合も、知識グラフに含まれる所定の要素(文字列)をそれに対応する単語(文字列)に変換する変換規則を併用してもよい。例えば、エッジに付随する情報が、上記の{介在}ではなく、{device:smartphone}というものであったとする。この場合、{smartphone:スマートフォン、device:を使って}のような対応表を記憶させておけばよい。この対応表と、例えば“{ノード}を{エッジに付随する情報}{エッジ}した。”というテンプレートとを用いれば、“つぶやきをスマートフォンを使って投稿した。”というテキストを生成することができる。
 また、データ変換部202は、{ノード}の部分はそのまま「ユーザ」とした上で、図7に示したERの例のように、そのノードに関連する情報を示すテキストを追加してもよい。例えば、データ変換部202は、上記のテキストにおける“ビリーとフォローの関係にある。”の部分を“名前がビリーで年齢が16のユーザとフォローの関係にある。”とのテキストに変換してもよい。
 このように、ノードやリンクに付与されている情報についてもテキストに変換してもよい。例えば、図9の例における「つぶやき」のノードには投稿内容を示すテキストと日付の情報が付与されている。データ変換部202は、これらの情報を用いて、“つぶやきをスマートフォンで投稿して、内容は「今東京にいる」であり、日付は20xx年6月21日である。”のようなテキストを生成してもよい。
 また、リンクの矢印の向きを考慮したテンプレートを用いてもよい。例えば、リンクの矢印の終点側のノードについては“{ノード}と{エッジ}の関係にある。”との半構造化データ用テンプレートを使用し、リンクの矢印の始点側のノードについては“{ノード}に{エッジ}される関係にある。”との半構造化データ用テンプレートを使用してもよい。これにより、図7に示す知識グラフに含まれるユーザ「アリス」に関する記述を変換すると、“ビリーとフォローの関係にある。クラウスにフォローされる関係にある。ビリーにフォローされる関係にある。”とのテキストが生成される。
 なお、図9に示したような半構造化データ用テンプレート2の適用対象は知識グラフに限られず、例えばSNSの友達グラフ等についても同様の変換規則によりテキストに変換することができる。
 以上のように、対象データ211がグラフ形式の半構造化データである場合には、データ変換部202は、ノードの内容を示す文字列と、当該ノードに接続するリンクの内容を示す文字列とを半構造化データ用テンプレート212に入力することにより対象データをテキストに変換してもよい。この構成によれば、例示的実施形態1に係るデータ変換装置1の奏する効果に加えて、グラフ形式の半構造化データをテキスト化することが可能になるという効果が得られる。
 (サンプリングの工夫)
 データ変換部202は、対象データがどのような形式であったとしても、その全ての要素をテキスト化する必要はなく、対象データから一部の要素をサンプリングしてテキスト化してもよい。例えば、対象データが1つのテーブルである場合、データ変換部202は、対象データを構成する行の一部をランダムにサンプリングし、サンプリングした行からテキストを生成してもよい。
 また、例えば、データ変換部202は、欠損値が含まれていない等の所定の条件を満たす行をサンプリングしてもよい。さらに、例えば、データ変換部202は、列内のユニークな要素の数に応じてサンプリングを行ってもよい。ここで、ユニークな要素とはテーブルデータのある列において、重複がない要素を指す。例えば、1000行のテーブル(対象データ)に含まれる「場所」という列に47個しかユニークな要素が存在しなかったとする。例えば「場所」が日本の都道府県を示す列である場合にはこのような状態となり得る。この場合、何も工夫しなければ、同じ都道府県が重複して多数含まれるテキストが生成されてしまう。
 このような場合、データ変換部202は、ある「場所」を含む行をテキストに変換した後は、同じ「場所」を含む行はテキストに変換しない、つまりサンプリングしないようにしてもよい。また、データ変換部202は、「場所」を含む行が、予め定めた上限を超えないようにサンプリングしてもよい。
 このように、データ変換部202は、対象データがテーブル形式の構造化データであり、同じ要素を含む複数の行を含んでいる場合に、同じ要素を含む複数の行の一部をサンプリングして、サンプリングした行に含まれる文字列をテキストに変換してもよい。この構成によれば、例示的実施形態1に係るデータ変換装置1の奏する効果に加えて、生成されるテキストの冗長性を低減することができるという効果が得られる。
 また、例えば、1000行のテーブル(対象データ)において、ある列に1000個のユニークな要素が存在したとする。例えば、IDや個人名等を示す列においてはこのような状態となり得る。IDや個人名は、それら単体では対象データの内容に関する説明力が低く、テキストにそれらの情報を含める必要性は低い。
 このため、データ変換部202は、テーブル形式の構造化データに含まれる各列について、その列に含まれるユニークな要素数の、対象データの行数に対する比、つまり(ユニークな要素数)/(行数)の値を計算し、その値が閾値以上である列の要素はテキストに含めないようにしてもよい。これにより、例示的実施形態1に係るデータ変換装置1の奏する効果に加えて、生成されるテキストの冗長性を低減することができるという効果が得られる。
 (処理の流れ)
 データ変換装置2が実行する処理(データ変換方法)の流れを図10に基づいて説明する。図10は、データ変換装置2が実行する処理の流れを示すフロー図である。
 S21では、データ取得部201が、対象データ211を取得する。S21で取得される対象データ211は、例えばデータ変換装置2のユーザが入力部22を介して入力したものであってもよい。ここでは、対象データ211が半構造化データおよび構造化データの何れかであるとする。なお、データ取得部201は、対象データ211に加えて、対象データ211の変換に用いるテンプレート、すなわち半構造化データ用テンプレート212または構造化データ用テンプレート213についても取得してもよい。
 S22では、データ変換部202が、S21で入力された対象データ211が半構造化データであるか否か、つまり対象データ211が半構造化データであるか構造化データであるかを判定する。S22の判定方法は任意であり、例えば、データ変換部202は、対象データ211の拡張子から、対象データ211が半構造化データであるか構造化データであるかを判定してもよい。
 S22でYESと判定された場合、つまり、S21で入力された対象データ211が半構造化データである場合には、S23に進む。S23では、データ変換部202は、半構造化データ用テンプレート212を用いて、S21で入力された対象データ211をテキストに変換する。また、データ変換部202は、変換により得られたテキストをテキスト214として記憶部21に記憶させ、これにより図10の処理は終了する。なお、データ変換部202は、テキスト214を出力部23または他の装置に出力させてもよい。
 一方、S22でNOと判定された場合、つまり、S21で入力された対象データ211が構造化データである場合には、S24に進む。S24では、データ変換部202は、構造化データ用テンプレート213を用いて、S21で入力された対象データ211をテキストに変換する。この際、データ変換部202は、「サンプリングの工夫」の項目で説明したようなサンプリングを行ってもよい。対象データ211の変換により得られたテキストの記憶と出力についてはS23と同様である。
 なお、同じ半構造化データであっても、データ形式に応じて適切な半構造化データ用テンプレート212が異なる場合があるから、データ形式毎に半構造化データ用テンプレート212を用意しておいてもよい。これは構造化データについても同様である。この場合、データ変換部202は、対象データ211のデータ形式を判定して、そのデータ形式に応じたテンプレート(半構造化データ用テンプレート212または構造化データ用テンプレート213)を適用して変換を行えばよい。
 〔変形例〕
 データ変換装置2は、「変換により得られたテキストの利用について」で説明したような各種の処理についても実行するものであってもよい。例えば、データ変換装置2は、対象データを変換することにより生成されたテキストに付与すべきラベルを推定するラベル推定手段を備えていてもよい。また、ラベルの推定にはゼロショットテキスト分類器を用いてもよい。
 また、例えば、データ変換装置2は、複数の対象データを変換することにより生成された複数のテキスト間の類似度を算出する類似度算出手段を備えていてもよい。また、データ変換装置2は、類似度の算出にあたり、テキストを埋め込みベクトルに変換するベクトル変換手段を備えていてもよい。さらに、データ変換装置2は、算出された上記類似度に基づいて、対象データに類似する類似データを検出する類似データ検出手段を備えていてもよい。
 上述の実施形態で説明した各処理の実行主体は任意であり、上述の例に限られない。つまり、相互に通信可能な複数の装置により、データ変換装置2と同様の機能を有する推定システムを構築することができる。例えば、図4に示す各ブロックを複数の装置に分散して設けることにより、データ変換装置2と同様の機能を有する推定システムを構築することができる。
 〔ソフトウェアによる実現例〕
 データ変換装置2の一部又は全部の機能は、集積回路(ICチップ)等のハードウェアによって実現してもよいし、ソフトウェアによって実現してもよい。後者の場合、データ変換装置2は、例えば、各機能を実現するソフトウェアであるプログラム(推定プログラム)の命令を実行するコンピュータによって実現される。このようなコンピュータの一例(以下、コンピュータCと記載する)を図11に示す。コンピュータCは、少なくとも1つのプロセッサC1と、少なくとも1つのメモリC2と、を備えている。メモリC2には、コンピュータCをデータ変換装置2として動作させるためのプログラムPが記録されている。コンピュータCにおいて、プロセッサC1は、プログラムPをメモリC2から読み取って実行することにより、データ変換装置2の各機能が実現される。
 プロセッサC1としては、例えば、CPU(Central Processing Unit)、GPU(Graphic Processing Unit)、DSP(Digital Signal Processor)、MPU(Micro Processing Unit)、FPU(Floating point number Processing Unit)、PPU(Physics Processing Unit)、マイクロコントローラ、又は、これらの組み合わせなどを用いることができる。メモリC2としては、例えば、フラッシュメモリ、HDD(Hard Disk Drive)、SSD(Solid State Drive)、又は、これらの組み合わせなどを用いることができる。
 なお、コンピュータCは、プログラムPを実行時に展開したり、各種データを一時的に記憶したりするためのRAM(Random Access Memory)を更に備えていてもよい。また、コンピュータCは、他の装置との間でデータを送受信するための通信インタフェースを更に備えていてもよい。また、コンピュータCは、キーボードやマウス、ディスプレイやプリンタなどの入出力機器を接続するための入出力インタフェースを更に備えていてもよい。
 また、プログラムPは、コンピュータCが読み取り可能な、一時的でない有形の記録媒体Mに記録することができる。このような記録媒体Mとしては、例えば、テープ、ディスク、カード、半導体メモリ、又はプログラマブルな論理回路などを用いることができる。コンピュータCは、このような記録媒体Mを介してプログラムPを取得することができる。また、プログラムPは、伝送媒体を介して伝送することができる。このような伝送媒体としては、例えば、通信ネットワーク、又は放送波などを用いることができる。コンピュータCは、このような伝送媒体を介してプログラムPを取得することもできる。
 〔付記事項1〕
 本発明は、上述した実施形態に限定されるものでなく、請求項に示した範囲で種々の変更が可能である。例えば、上述した実施形態に開示された技術的手段を適宜組み合わせて得られる実施形態についても、本発明の技術的範囲に含まれる。
 〔付記事項2〕
 上述した実施形態の一部又は全部は、以下のようにも記載され得る。ただし、本発明は、以下の記載する態様に限定されるものではない。
 (付記1)
 半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段と、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換手段と、を備えるデータ変換装置。
 (付記2)
 前記データ変換手段は、前記対象データが半構造化データである場合には前記半構造化データ用テンプレートを用いて前記対象データをテキストに変換し、前記対象データが構造化データである場合には前記構造化データ用テンプレートを用いて前記対象データをテキストに変換する、付記1に記載のデータ変換装置。
 (付記3)
 前記データ変換手段は、前記対象データに関連する関連データが存在する場合に、前記対象データを、前記関連データを前記半構造化データ用テンプレートまたは前記構造化データ用テンプレートを用いて変換することにより得られる文字列を含むテキストに変換する、付記1または2に記載のデータ変換装置。
 (付記4)
 前記データ変換手段は、前記対象データが、タグを含む半構造化データである場合、前記タグの内容を示す文字列と当該タグに記述された文字列とを前記半構造化データ用テンプレートに入力することにより前記対象データをテキストに変換する、付記1から3の何れか1つに記載のデータ変換装置。
 (付記5)
 前記データ変換手段は、前記対象データが、複数のノード間の関係がリンクにより示されたグラフ形式のデータである場合、ノードの内容を示す文字列と、当該ノードに接続するリンクの内容を示す文字列とを前記半構造化データ用テンプレートに入力することにより前記対象データをテキストに変換する、付記1から4の何れか1つに記載のデータ変換装置。
 (付記6)
 前記データ変換手段は、前記対象データがテーブル形式の構造化データである場合に、同じ要素を含む複数の行の一部をサンプリングして、サンプリングした行に含まれる文字列をテキストに変換する、付記1から5の何れか1つに記載のデータ変換装置。
 (付記7)
 前記データ変換手段は、前記対象データがテーブル形式の構造化データである場合に、当該対象データに含まれる列のうち、当該列に含まれるユニークな要素数の、当該対象データの行数に対する比が閾値以上である列の要素を含めることなく当該対象データをテキストに変換する、付記1から6の何れか1つに記載のデータ変換装置。
 (付記8)
 少なくとも1つのプロセッサが、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得することと、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換することと、を含む、データ変換方法。
 (付記9)
 コンピュータを、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段、および半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換手段、として機能させる、データ変換プログラム。
 〔付記事項3〕
 上述した実施形態の一部又は全部は、更に、以下のように表現することもできる。少なくとも1つのプロセッサを備え、前記プロセッサは、半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得処理と、半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換処理と、を実行するデータ変換装置。
 なお、このデータ変換装置は、更にメモリを備えていてもよく、このメモリには、前記データ取得処理と、前記データ変換処理とを前記プロセッサに実行させるためのプログラムが記憶されていてもよい。また、このプログラムは、コンピュータ読み取り可能な一時的でない有形の記録媒体に記録されていてもよい。
1、2    データ変換装置
11、201 データ取得部
12、202 データ変換部
211    対象データ
212    半構造化データ用テンプレート
213    構造化データ用テンプレート

Claims (9)

  1.  半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段と、
     半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換手段と、を備えるデータ変換装置。
  2.  前記データ変換手段は、前記対象データが半構造化データである場合には前記半構造化データ用テンプレートを用いて前記対象データをテキストに変換し、前記対象データが構造化データである場合には前記構造化データ用テンプレートを用いて前記対象データをテキストに変換する、請求項1に記載のデータ変換装置。
  3.  前記データ変換手段は、前記対象データに関連する関連データが存在する場合に、前記対象データを、前記関連データを前記半構造化データ用テンプレートまたは前記構造化データ用テンプレートを用いて変換することにより得られる文字列を含むテキストに変換する、請求項1または2に記載のデータ変換装置。
  4.  前記データ変換手段は、前記対象データが、タグを含む半構造化データである場合、前記タグの内容を示す文字列と当該タグに記述された文字列とを前記半構造化データ用テンプレートに入力することにより前記対象データをテキストに変換する、請求項1から3の何れか1項に記載のデータ変換装置。
  5.  前記データ変換手段は、前記対象データが、複数のノード間の関係がリンクにより示されたグラフ形式のデータである場合、ノードの内容を示す文字列と、当該ノードに接続するリンクの内容を示す文字列とを前記半構造化データ用テンプレートに入力することにより前記対象データをテキストに変換する、請求項1から4の何れか1項に記載のデータ変換装置。
  6.  前記データ変換手段は、前記対象データがテーブル形式の構造化データである場合に、同じ要素を含む複数の行の一部をサンプリングして、サンプリングした行に含まれる文字列をテキストに変換する、請求項1から5の何れか1項に記載のデータ変換装置。
  7.  前記データ変換手段は、前記対象データがテーブル形式の構造化データである場合に、当該対象データに含まれる列のうち、当該列に含まれるユニークな要素数の、当該対象データの行数に対する比が閾値以上である列の要素を含めることなく当該対象データをテキストに変換する、請求項1から6の何れか1項に記載のデータ変換装置。
  8.  少なくとも1つのプロセッサが、
     半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得することと、
     半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換することと、を含む、データ変換方法。
  9.  コンピュータを、
     半構造化データまたは構造化データを、テキストに変換する対象となる対象データとして取得するデータ取得手段、および
     半構造化データをテキストに変換するための半構造化データ用テンプレートまたは構造化データをテキストに変換するための構造化データ用テンプレートを用いて、前記対象データをテキストに変換するデータ変換手段、として機能させる、データ変換プログラム。

     
PCT/JP2022/003536 2022-01-31 2022-01-31 データ変換装置、データ変換方法、およびデータ変換プログラム WO2023145052A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/003536 WO2023145052A1 (ja) 2022-01-31 2022-01-31 データ変換装置、データ変換方法、およびデータ変換プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/003536 WO2023145052A1 (ja) 2022-01-31 2022-01-31 データ変換装置、データ変換方法、およびデータ変換プログラム

Publications (1)

Publication Number Publication Date
WO2023145052A1 true WO2023145052A1 (ja) 2023-08-03

Family

ID=87470964

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/003536 WO2023145052A1 (ja) 2022-01-31 2022-01-31 データ変換装置、データ変換方法、およびデータ変換プログラム

Country Status (1)

Country Link
WO (1) WO2023145052A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0765011A (ja) * 1993-08-31 1995-03-10 Matsushita Electric Ind Co Ltd 説明書生成装置及びその方法
JP2004334369A (ja) * 2003-05-01 2004-11-25 Nippon Telegr & Teleph Corp <Ntt> 音声対話シナリオ変換方法、音声対話シナリオ変換装置、音声対話シナリオ変換プログラム
JP2005316031A (ja) * 2004-04-28 2005-11-10 Nippon Hoso Kyokai <Nhk> データ放送コンテンツ受信変換装置およびデータ放送コンテンツ受信変換プログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0765011A (ja) * 1993-08-31 1995-03-10 Matsushita Electric Ind Co Ltd 説明書生成装置及びその方法
JP2004334369A (ja) * 2003-05-01 2004-11-25 Nippon Telegr & Teleph Corp <Ntt> 音声対話シナリオ変換方法、音声対話シナリオ変換装置、音声対話シナリオ変換プログラム
JP2005316031A (ja) * 2004-04-28 2005-11-10 Nippon Hoso Kyokai <Nhk> データ放送コンテンツ受信変換装置およびデータ放送コンテンツ受信変換プログラム

Similar Documents

Publication Publication Date Title
Akhtar et al. How intense are you? Predicting intensities of emotions and sentiments using stacked ensemble [application notes]
CN108959246B (zh) 基于改进的注意力机制的答案选择方法、装置和电子设备
JP6231944B2 (ja) 学習モデル作成装置、判定システムおよび学習モデル作成方法
CN111931517B (zh) 文本翻译方法、装置、电子设备以及存储介质
CN111324696B (zh) 实体抽取方法、实体抽取模型的训练方法、装置及设备
US20170185913A1 (en) System and method for comparing training data with test data
Se et al. AMRITA-CEN@ SAIL2015: sentiment analysis in Indian languages
CN116189865A (zh) 医院预约登记管理系统
Das et al. Sentence embedding models for similarity detection of software requirements
CN116610803A (zh) 基于大数据的产业链优企信息管理方法及系统
US20220139069A1 (en) Information processing system, information processing method, and recording medium
WO2023145052A1 (ja) データ変換装置、データ変換方法、およびデータ変換プログラム
Viswanathan et al. Detection of duplicates in Quora and Twitter corpus
Zhang et al. Applying artificial intelligence methods for the estimation of disease incidence: The utility of language models
WO2023162206A1 (ja) 情報処理装置、情報処理方法及び情報処理プログラム
Ouamour et al. Effect of the text size on stylometry—application on Arabic religious texts
WO2023145051A1 (ja) 推定装置、推定方法、および推定プログラム
JP2011039576A (ja) 特定情報検出装置、特定情報検出方法および特定情報検出プログラム
JP6026036B1 (ja) データ分析システム、その制御方法、プログラム、及び、記録媒体
JP2016162163A (ja) 情報処理装置及び情報処理プログラム
Islam et al. Ishara-Bochon: the first multipurpose open access dataset for Bangla sign language isolated digits
Walkowiak et al. Reduction of dimensionality of feature vectors in subject classification of text documents
JP6813432B2 (ja) 文書処理装置、文書処理方法及びプログラム
Li Characterizing ranked Chinese syllable-to-character mapping spectrum: A bridge between the spoken and written Chinese language
Denisiuk et al. Feature Extraction for Polish Language Named Entities Recognition in Intelligent Office Assistant.

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: 22923915

Country of ref document: EP

Kind code of ref document: A1