Classification processing program and method

The classification processing program and method effectively classifies natural language text by embedding sentences into vectors and calculating similarities, achieving high accuracy and flexible category settings for detailed data analysis.

JP2026002703APending Publication Date: 2026-01-08川上成年
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024100882
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-06-22
Publication Date
2026-01-08

AI Technical Summary

Technical Problem

Existing technologies face challenges in efficiently classifying character strings written in natural language due to the complexity of processing such text.

Method used

A classification processing program and method that embeds classification explanation sentences and target sentences into vectors, calculates similarities, and classifies the target sentences based on these similarities, utilizing techniques like cosine similarity and quantum probability.

Benefits of technology

Enables high-accuracy classification of natural language text by maintaining semantic relationships and allowing flexible category settings, improving computational efficiency and enabling detailed data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026002703000001_ABST
    Figure 2026002703000001_ABST
Patent Text Reader

Abstract

To provide a program for classifying character strings.SOLUTION: Generating two or more classification description text vectors by performing embedding processing for a classification description text formed from a natural language that describes contents of two or more classifications, generating one or more classification target text vectors by performing embedding processing for a classification target text formed from one or more natural languages, calculating a plurality of similarities between each of the vectors of the two or more classification description texts and each of the vectors of the one or more classification target texts, and classifying the classification target text into a classification of the classification description text based on the plurality of similarities.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a classification processing program and method. [Background technology]

[0002] Patent Document 1 discloses a patent map generation program. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Patent No. 6586614 Summary of the Invention [Problem to be solved by the invention]

[0004] In Patent Document 1, text mining processing is used for character string classification processing. However, the processing of classifying character strings written in natural language is highly difficult.

[0005] The present invention has been made to solve such conventional problems, and has as its object to perform classification processing of character strings composed of natural languages. [Means for solving the problem]

[0006] The present invention is a classification processing program that causes a computer to execute the following processes: embedding classification explanation sentences written in natural languages ​​that explain the contents of two or more classifications and generating two or more classification explanation sentence vectors; embedding classification target sentences written in one or more natural languages ​​and generating one or more classification target sentence vectors; calculating a plurality of similarities between each of the vectors of the two or more classification explanation sentences and each of the vectors of the one or more classification target sentences; and classifying the classification target sentences into the classification of the classification explanation sentences based on the plurality of similarities.

[0007] The present invention is a classification processing method in which a computer embeds two or more classification explanation sentences written in a natural language that explain the content of a classification, generates classification explanation sentence vectors, embeds one or more sentences to be classified, written in a natural language, generates classification target sentence vectors, calculates a plurality of similarities between each of the vectors of the two or more classification explanation sentences and each of the vectors of the one or more sentences to be classified, and classifies the sentences to be classified into the classification of the classification explanation sentences based on the multiple similarities. [Effects of the Invention]

[0008] According to the classification processing program and method of the present invention, it is possible to perform classification processing of character strings written in natural language. [Brief explanation of the drawings]

[0009] [Figure 1] Schematic diagram of a system that executes a classification processing program [Figure 2] Block diagram of a device that executes a classification processing program [Figure 3] Classification process flowchart [Figure 4] Classification explanation text data [Figure 5] Text data to be classified [Figure 6] Similarity Matrix [Figure 7] Classification results [Figure 8] quantum probability [Figure 9] Classification by quantum probability DETAILED DESCRIPTION OF THE INVENTION

[0010] Hereinafter, the classification processing program and method according to the embodiment will be described in detail with reference to the drawings.

[0011] 1 is a schematic diagram of a system that executes a classification processing program. An information processing device (terminal 1) for executing the classification processing program is connected to a natural language processing server 2 via a network. In the embodiment, natural language processing embedding (also called "embedding") processing is executed by the natural language processing server 2, but it may also be executed by the information processing device 1. Embedding models that can be executed by the information terminal 1 include Word2Vec, GloVe, FastText, and BERT.

[0012] Embedding processing is a technique for converting data into a fixed-length vector format. This technique plays an important role in the fields of natural language processing (NLP) and machine learning. The basic flow of embedding processing is as follows:

[0013] First, in the data preparation stage, data such as text is collected, and then in the vectorization stage, the data is converted into fixed-length vectors using algorithms such as Word2Vec or GloVe. This conversion process is called embedding.

[0014] The benefits of embedding are many. First, it improves computational efficiency by converting high-dimensional data into low-dimensional vectors. Second, the embedding vectors preserve semantic relationships between data. For example, words with similar meanings are represented as close vectors.

[0015] The natural language processing server 2 is a computer that vectorizes an input character string. The natural language processing server 2 of the embodiment is a natural language processing server that provides a cloud-based service incorporating, for example, embedding models such as OpenAI's text-embedding-3-small, text-embedding-3-large, and text-embedding-ada-002 (all of which are API services). Note that the natural language processing server 2 is not limited to this, and may be any natural language processing server that provides a natural language processing service incorporating an embedding model that provides similar functions.

[0016] The natural language processing server 2 of the embodiment has a CPU, memory, input / output devices, and an external interface, and performs natural language processing incorporating an Embedding model (embedding processing in the embodiment) in response to input from an external device, and outputs the processing.

[0017] FIG. 2 is a block diagram of an information processing device (terminal 1) for executing the classification processing program of the embodiment.

[0018] A CPU (Central Processing Unit) 101, a ROM (Read Only Memory) 102, a RAM (Random Access Memory) 103, a HDD (Hard Disk Drive) 105, an external I / F (Interface) 106, and an input unit 107 are connected via a system bus 108. The CPU 101, the ROM 102, and the RAM 103 constitute a control unit 104.

[0019] The ROM 102 stores in advance programs and thresholds to be executed by the CPU 101. The RAM 103 has various memory areas, such as an area for expanding the programs executed by the CPU 101 and a work area that serves as a work area for data processing by the programs.

[0020] The HDD 105 stores natural language sentence data (patent data, questionnaire data, etc.) input from the input unit 107. The external I / F 106 is an interface for communicating with an external device such as an external server.

[0021] The external I / F 106 may be any interface that performs data communication with an external device, and may be, for example, a device (such as a USB memory) that connects locally to the external device, or a network interface for communication via a wired or wireless network.

[0022] The control unit 104 exchanges data with an external device (such as a natural language processing server) via the external I / F 106 to obtain the Python library required to execute the program, send string data, and receive classification results.

[0023] The external I / F 106 is connected to a display device (not shown) such as a liquid crystal display, etc. The input unit 107 is an input device such as a keyboard, a mouse, a scanner (reading device), etc.

[0024] (Embodiment 1) Next, the processing procedure of the classification processing program and method of the embodiment will be described. Note that in the embodiment, an example of classifying sentences on solutions for beer technology will be shown. The following code blocks 1 to 7 connected in succession are the program and method of the embodiment, and should basically be written consecutively. However, for ease of explanation, they will be divided into seven parts and explained.

[0025] 3 is a flowchart of the classification processing program and method according to the embodiment. In STEP 1, the classification explanation sentence is vectorized, in STEP 2 the classification target sentence is vectorized, in STEP 3 the similarity between the classification explanation sentence and the classification target sentence is calculated, and in STEP 4 the classification target sentence is assigned a classification based on the similarity.

[0026] In the embodiment, patent data (solutions for summarizing the data) is used as the text to be classified, but the text to be classified is not limited to this; text within the specification or claims may also be used, and text other than patent data, such as surveys or user reviews, may also be processed.

[0027] (STEP 1: Vectorization of classification description text) First, the control unit 104 of the terminal 1 transmits a plurality of classification explanation sentences to the natural language processing server 2, and the natural language processing server 2 vectorizes the classification explanation sentences. The program is as follows.

[0028] The following program is a Python program stored in the control unit 104 of the information processing device (terminal 1). However, other programming tools and programming languages ​​may be used. The following program is merely an example, and the processing order and the libraries, functions, and variable names used may be changed.

[0029] The control unit 104 imports a module called pandas. Pandas is a tool for performing data analysis in Python. Next, it imports a function called drive from a module called google.colab. Drive is a function for accessing Google Drive.

[0030] The control unit 104 executes the drive function to mount Google Drive to the path ' / content / drive'. Mounting means that files and folders in Google Drive can be operated on Colab.

[0031] (Code Block 1) # Library import import pandas as pd import numpy as np from sklearn.metrics.pairwise import cosine_similarity # Using Google Drive from google.colab import drive drive.mount(' / content / drive')

[0032] (Explanation of Code Block 1) - `import pandas as pd`: Imports the Pandas library for data manipulation and analysis. Pandas is a library for efficiently working with data using data frames. - `import numpy as np`: Imports the NumPy library for numerical calculations and matrix manipulation. NumPy is a library for efficiently manipulating multidimensional arrays. - `from sklearn.metrics.pairwise import cosine_similarity`: Imports a function used to calculate cosine similarity, which is used to calculate the similarity between two vectors. - `from google.colab import drive`: Imports a module for working with Google Drive on Google Colab. - `drive.mount(' / content / drive')`: Mounts Google Drive into the Colab environment, allowing you to access files in Google Drive.

[0033] Next, the control unit 104 installs the OpenAI Python library, which makes it possible to execute natural language processing tasks using the OpenAI API.

[0034] (Code Block 2) # Installing packages ! pip install openai from openai import OpenAI # Enter your API_KEY client = OpenAI(api_key)

[0035] (Explanation of Code Block 2) - `! pip install openai`: Installs the OpenAI Python client library. - `from openai import OpenAI`: Imports the OpenAI class from the OpenAI library. - `client = OpenAI(api_key)`: Initializes an OpenAI client with an API key, so you're ready to use the OpenAI API.

[0036] Next, the control unit 104 uses the pd.read_excel function to read the Excel files solution_class.xlsx and solution.xlsx in the path ' / content / drive / MyDrive / '.

[0037] Figure 4 shows the classification explanation sentence data stored in solution_class.xlsx. As shown in the figure, the classification explanation sentence data has a solution_class_name column that indicates the classification name and a solution_class_contents column that stores the classification explanation sentence. This classification explanation sentence is the target for vectorization. Of course, other columns may also be included.

[0038] Although the number of categories is five, it is of course possible to have more or fewer categories. This category description text data is solution data for beer. The category names and descriptions can be thought up by humans, or they can be suggested by a generation AI.

[0039] Figure 5 shows the text data to be classified, stored in solution.xlsx. As shown in the figure, the text to be classified is stored in the solution column. Note that the number of texts to be classified is 10, but it is of course possible to have more or less than this number. Note that this text data to be classified is extracted from the solution descriptions in the patent data summaries.

[0040] (Code Block 3) # Load data (from Google Drive) df1 = pd.read_excel(' / content / drive / MyDrive / solution_class.xlsx') df2 = pd.read_excel(' / content / drive / MyDrive / solution.xlsx')

[0041] (Explanation of Code Block 3) - `pd.read_excel`: Read an Excel file using Pandas. - `df1 = pd.read_excel(' / content / drive / MyDrive / solution_class.xlsx')`: Read the `solution_class.xlsx` file in Google Drive and store it in the data frame `df1`. This file contains data on the classification description sentences. - `df2 = pd.read_excel(' / content / drive / MyDrive / solution.xlsx')`: Read the `solution.xlsx` file in Google Drive and store it in the data frame `df2`. This file contains data on multiple sentences to be classified.

[0042] Next, the natural language processing server 2 vectorizes the classification explanation text. The process is as follows.

[0043] (Code Block 4) # Embedding processing function def get_embedding(text, model="text-embedding-3-small"): text = text.replace("\n", " ") return client.embeddings.create(input = [text], model=model).data[0].embedding # Add the embedding result to a new column (solution_class_vec) df1['solution_class_vec'] = df1['solution_class_contents'].apply(lambda x: get_embedding(x, model='text-embedding-3-small'))

[0044] (Explanation of Code Block 4) - `def get_embedding(text, model="text-embedding-3-small"):`: Defines a function that converts text into an embedding vector using the specified model (text-embedding-3-small). - `text.replace("\n", " ")`: Replaces newlines in the text with spaces. This formats the text into a single line. - `client.embeddings.create(input = [text], model=model).data[0].embedding`: Converts text into embedding vectors using OpenAI's API (text-embedding-3-small). - `df1['solution_class_vec'] = df1['solution_class_contents'].apply(lambda x: get_embedding(x, model='text-embedding-3-small'))`: Apply the `get_embedding` function to each row of the `solution_class_contents` column in `df1` and add the result to a new column `solution_class_vec`. This converts each classification description text into a vector representation.

[0045] This process converts each classification description sentence into a 1536-dimensional vector (the vectors are omitted due to their length). This vector is called the classification description sentence vector.

[0046] (STEP 2: Vectorization of the text to be classified) Next, the natural language processing server 2 vectorizes the sentences to be classified. The process is as follows.

[0047] (Code Block 5) # Add the embedding result to a new column (solution_vec) df2['solution_vec'] = df2['solution'].apply(lambda x: get_embedding(x, model='text-embedding-3-small'))

[0048] (Explanation of Code Block 5) - `df2['solution_vec'] = df2['solution'].apply(lambda x: get_embedding(x, model='text-embedding-3-small'))`: Apply the `get_embedding` function to each row of the `solution` column in `df2` and add the result to a new column `solution_vec`. This converts each target sentence into a vector representation.

[0049] This process converts each sentence to be classified into a 1536-dimensional vector (the vector is not shown because it is a long sentence). This vector is used as the sentence vector to be classified.

[0050] (STEP 3: Similarity calculation step) The control unit 104 calculates the cosine similarity between each category explanation sentence vector and each category target sentence vector. Note that the similarity may not be limited to the cosine similarity, but may be, for example, Euclidean distance, Manhattan distance, Minkowski distance, Chebyshev distance, Jaccard coefficient, Pearson correlation coefficient, or the like.

[0051] (Code Block 6) # Function to calculate cosine similarity def calculate_cosine_similarity_matrix(vecs1, vecs2): vecs1 = np.array(vecs1.tolist()) vecs2 = np.array(vecs2.tolist()) return cosine_similarity(vecs1, vecs2) # Calculate the cosine similarity matrix similarity_matrix = calculate_cosine_similarity_matrix(df2['solution_vec'], df1['solution_class_vec']) # Convert the result to a data frame similarity_df = pd.DataFrame(similarity_matrix, index=df2.index, columns=df1.index)

[0052] (Explanation of Code Block 6) - `def calculate_cosine_similarity_matrix(vecs1, vecs2):`: Defines a function to calculate the cosine similarity matrix between two vector lists. - `vecs1 = np.array(vecs1.tolist())`: Converts `vecs1` to a NumPy array. `tolist()` is a method that converts columns of a data frame to a list. - `vecs2 = np.array(vecs2.tolist())`: Convert `vecs2` to a NumPy array. - `return cosine_similarity(vecs1, vecs2)`: Calculates the cosine similarity between two vector lists and returns the result. - `similarity_matrix = calculate_cosine_similarity_matrix(df2['solution_vec'], df1['solution_class_vec'])`: Calculate the cosine similarity between the `solution_vec` in `df2` and the `solution_class_vec` in `df1`, and store the result in `similarity_matrix`. - `similarity_df = pd.DataFrame(similarity_matrix, index=df2.index, columns=df1.index)`: Convert the similarity matrix into a data frame and store it in `similarity_df`. This will represent the similarity between each classification description sentence and the classification target sentence in matrix form.

[0053] Figure 6 shows the generated similarity matrix (similarity_matrix). As shown in the figure, the individual similarities of each classification explanation sentence to each solution (sentence to be classified) are calculated. To simplify the figure, the sentences in the solution column have been replaced with numbers indicating their order, such as 1, 2, and 3. Similarly, the item names in the classification column have been replaced with the classification explanation sentence (solution_class_contents) and the classification name (solution_class_name).

[0054] (STEP 4: Classification step) The control unit 104 classifies the target sentences into the category explanation sentence with the maximum similarity among the vectors of the target sentences and the cosine similarities of the vectors of the target sentences. The process is as follows.

[0055] (Code Block 7) ##Classification assignment # Add solution_class_name with maximum similarity to df2 df2['max_similarity_class_index'] = similarity_df.idxmax(axis=1) df2['max_similarity_value'] = similarity_df.max(axis=1) # Add solution_class_name with max_similarity_class_index df2 = df2.merge(df1[['solution_class_name']], left_on='max_similarity_class_index', right_index=True, how='left') # Adjust column names df2.rename(columns={'solution_class_name': 'max_similarity_class'}, inplace=True)

[0056] (Explanation of Code Block 7) - `df2['max_similarity_class_index'] = similarity_df.idxmax(axis=1)`: For each classification description, get the index of the class with the highest similarity and add it to the `max_similarity_class_index` column. `idxmax(axis=1)` returns the index of the maximum value for each row. - `df2['max_similarity_value'] = similarity_df.max(axis=1)`: For each target sentence, add the highest similarity value to the `max_similarity_value` column. `max(axis=1)` returns the maximum value for each row. - `df2 = df2.merge(df1[['solution_class_name']], left_on='max_similarity_class_index', right_index=True, how='left')`: Merge the corresponding `solution_class_name` from `df1` using `max_similarity_class_index` into `df2`. This adds to each classification target sentence the name of the classification description sentence that is most similar to it. - `df2.rename(columns={'solution_class_name': 'max_similarity_class'}, inplace=True)`: Rename the column `solution_class_name` to `max_similarity_class`, so that in the resulting dataframe it represents the name of the most similar classification description sentence.

[0057] Figure 7 shows the classification results. As shown in the figure, a classification (max_similarity_class) is assigned to each classification target sentence (solution 1 to 10). For example, the classification target sentence solution 1 is assigned the classification of amino acid system. Note that to simplify the figure, the solution column has been replaced with numbers indicating the order 1, 2, 3.

[0058] In the embodiment, the classification with the highest similarity is assigned, but multiple classifications, such as the top two or three similarities, may be assigned. For example, if the top three similarities are 50%, 45%, and 40%, all of these classifications can be assigned. Assigning the top two or three similarity classifications enables classification from multiple perspectives, which is useful for more detailed analysis and multifaceted data analysis.

[0059] Alternatively, a predetermined similarity value may be used as a threshold, and a classification above that value may be assigned. For example, the threshold may be set to 40%, and only classifications with a similarity above that value may be assigned. By setting a predetermined similarity value as the threshold and assigning a classification above that value, it is possible to increase the accuracy of classification and eliminate uncertain classifications.

[0060] As described above, the classification processing program and method of the embodiment converts classification explanation sentences into vectors and calculates the similarity with the classification target sentences, thereby enabling classification of the classification target sentences with high validity.

[0061] The classification processing program and method of the present invention provide the following advantages.

[0062] (High accuracy classification) By vectorizing classification explanation sentences and calculating the similarity with the classification target sentences, it is possible to classify the classification target sentences with higher accuracy than conventional methods. This allows for efficient and accurate classification of large amounts of data such as patent data, papers, and surveys. Compared to conventional methods, the method of the present invention achieves higher classification accuracy because it performs classification while maintaining the semantic relationships of classification strings written in natural language.

[0063] (flexible scope of application) As explained in the embodiments, the method can be applied to various types of text data, including not only patent data but also papers, surveys, and user reviews. The method of the present invention is compatible with a variety of data sources and embedding models, enabling a wide range of applications. This allows it to function effectively in different fields and applications.

[0064] (Efficient processing) Embedding processes convert high-dimensional data into low-dimensional vectors, improving computational efficiency and enabling rapid processing of large data sets. Embedding processes improve computational efficiency and enabling rapid processing of large data sets.

[0065] (versatility) The classification categories can be flexibly set according to various purposes, including not only solutions but also issues, needs, quality, effects, uses, and benefits, allowing for a wide range of analyses. Flexible classification category settings allow for a variety of analytical purposes, making it useful for supporting corporate marketing analysis and research and development.

[0066] As described above, the classification processing program and method of the present invention have high classification accuracy, a flexible range of application, efficient processing, and high versatility, and provide new value in the field of natural language processing.

[0067] (Embodiment 2) (STEP 5: Quantum probability calculation step) In the first embodiment, classification was performed based on the magnitude of similarity. However, since the solution is configured by combining various elements, it may be difficult to perform strict classification. In the second embodiment, classification is performed using quantum probabilistic methods by calculating the probability that each classification applies to the text to be classified. Note that a description of parts of the program common to the first embodiment will be omitted.

[0068] The control unit 104 calculates the quantum probability from the cosine similarity between the vector of each category explanation sentence and the vector of each classification target sentence. The process is as follows.

[0069] (Code Block 8) Calculating quantum probability # Define a function to extract the values ​​from each row and simulate quantum measurements def simulate_quantum_measurement(row): amplitudes = np.array(row) state = amplitudes / np.linalg.norm(amplitudes) quantum_probabilities = np.abs(state)**2 return quantum_probabilities # Get numeric columns of a data frame numerical_data = similarity_df # Calculate the quantum probability for each row df_quantum_probabilities = numerical_data.apply(simulate_quantum_measurement, axis=1) # Convert quantum probabilities to a data frame df_quantum_probabilities = pd.DataFrame(df_quantum_probabilities.tolist(), index=df2['solution'], columns=df1['solution_class_name'])

[0070] (Explanation of Code Block 8) # Define a function to extract the values ​​from each row and simulate quantum measurements def simulate_quantum_measurement(row): amplitudes = np.array(row) state = amplitudes / np.linalg.norm(amplitudes) quantum_probabilities = np.abs(state)**2 return quantum_probabilities - Define a function to simulate quantum measurements: - `amplitudes = np.array(row)`: Converts a row of a data frame into a NumPy array. - `state = amplitudes / np.linalg.norm(amplitudes)`: Normalize the row vector (make its norm 1). This is a standard operation for representing quantum states. - `quantum_probabilities = np.abs(state)**2`: Square the absolute value of each element of the normalized vector. This calculates the probability of the quantum state. - `return quantum_probabilities`: Return quantum probabilities. # Get numeric columns of a data frame numerical_data = similarity_df - Obtaining numerical data: Obtain the similarity data frame (`similarity_df`) as numerical data, which will be used to prepare the data for later quantum probability calculations. # Calculate the quantum probability for each row df_quantum_probabilities = numerical_data.apply(simulate_quantum_measurement, axis=1) - Calculate quantum probabilities for each row: - `numerical_data.apply(simulate_quantum_measurement, axis=1)`: Apply the `simulate_quantum_measurement` function defined above to each row of the data frame. `axis=1` means to apply the function row-wise. - This operation calculates the quantum probability for each line (each target sentence) and stores it in the data frame `df_quantum_probabilities`. # Convert quantum probabilities to a data frame df_quantum_probabilities = pd.DataFrame(df_quantum_probabilities.tolist(), index=df2['solution'], columns=df1['solution_class_name']) - Convert quantum probabilities to a new data frame: - `df_quantum_probabilities.tolist()`: Convert `df_quantum_probabilities` to list format. - `pd.DataFrame(..., index=df2['solution'], columns=df1['solution_class_name'])`: Convert the quantum probabilities in list format into a new data frame, and set the row index to the `solution` column of `df2` and the column index to the `solution_class_name` column of `df1`. This will create a data frame containing the quantum probabilities corresponding to each classification target sentence and classification explanation sentence.

[0071] Figure 8 shows the obtained quantum probabilities. As shown in the figure, quantum probabilities for amino acids, esters, aldehydes, acids, and alcohols are assigned to each classification target sentence (solutions 1 to 10). The sum of the quantum probabilities for each line is 1.

[0072] For example, a quantum probability of 0.2 or more, calculated by dividing 1 by the number of categories (5 in this embodiment), can be assigned as a category (the shaded portion in FIG. 8). By classifying in this way, for example, it is possible to grasp the multiple categories that make up each classification target sentence. The code for assigning a quantum probability of 0.2 or more as a category is shown below. Note that the threshold is not limited to 0.2 and may be set arbitrarily. Based on the quantum probability, a process is executed to classify the classification target sentence into the category of the classification explanation sentence that exceeds a predetermined threshold.

[0073] (Code Block 9) ###Quantum probability 0.2 or higher classification # Function to find column names with values ​​>= 0.2 for each row def find_columns_with_high_values(row): return ', '.join(row.index[row >= 0.2].tolist()) # Apply the function to each row to create the new column df_quantum_probabilities['High_Value_Columns'] = df_quantum_probabilities.apply(find_columns_with_high_values, axis=1)

[0074] (Explanation of Code Block 9) This code block lists the names of columns with values ​​greater than or equal to 0.2 for each row in the data frame df_quantum_probabilities and stores them in a new column called High_Value_Columns. First, a function find_columns_with_high_values ​​is defined. This function takes a row as input, finds the columns in that row with a value greater than or equal to 0.2, and converts them into a comma-separated string.

[0075] Next, we apply this function to each row of the data frame. We use df_quantum_probabilities.apply(find_columns_with_high_values, axis=1) to apply the function row by row and store the results in a new column, High_Value_Columns. This process saves the names of columns with values ​​greater than or equal to 0.2 in each row of the data frame as a comma-separated string. This allows us to easily see and analyze data that meets a specific condition.

[0076] FIG. 9 shows the classifications assigned. As shown in the figure, a classification of amino acids, esters, aldehydes, acids, or alcohols is assigned to each classification target sentence (solutions 1 to 10). For example, solution 1 is classified into multiple categories such as amino acids and acids, and solution 2 is classified into multiple categories such as aldehydes and alcohols. In addition, in FIG. 9, classification into acids is performed, which produces a result different from the classification based on similarity in FIG. 7. Furthermore, quantum probability makes it easier to compare the classifications between solutions 1 to 10. Furthermore, quantum probability makes it possible to set a common threshold, making processing easier. The classification processing program and method using quantum probability of the present invention achieve the following technical effects.

[0077] Classification from multiple perspectives: By using quantum probability, even if each target sentence falls into multiple categories, it can be assigned multiple categories according to its probability. This makes it possible to capture various aspects of the target sentence, which is useful for more detailed analysis and multifaceted data analysis.

[0078] Highly accurate classification: Compared to the conventional single classification based on similarity, the use of quantum probability improves classification accuracy because it can more accurately reflect subtle differences in the text to be classified by considering the probability of each classification.

[0079] Flexible classification settings: By using quantum probability, for example, by setting a predetermined threshold, it is possible to assign classifications only with a certain probability or higher. This flexible setting improves the accuracy and reliability of classification, and allows customization according to user needs.

[0080] Efficient processing: The process of calculating quantum probability can be parallelized, enabling rapid processing even for large data sets. This significantly improves the efficiency of data classification and analysis. Due to the above technical effects, the classification processing program and method using quantum probability of the present invention provide new value in the field of natural language processing and enable a wide range of applications.

[0081] In the above embodiment, processing using Python has been described, but the present invention is not limited to this, and similar processing can also be performed by combining a spreadsheet such as Excel with an API.

[0082] Furthermore, the classification categories are not limited to solutions, and may be classified into categories such as issues, needs, quality, effects, uses, and benefits depending on the purpose of the analysis, provided that an explanation of the classification is provided. Furthermore, the character strings to be classified are not limited to patent data, and may be any character string in natural language, such as a paper.

[0083] Although the embodiment has been described above, this embodiment is presented as an example and is not intended to limit the scope of the invention. This novel embodiment can be embodied in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. This embodiment and its modifications are included within the scope and spirit of the invention, and are also included in the inventions and their equivalents as set forth in the claims. [Explanation of symbols]

[0084] 1 terminal, 2 natural language processing server, 101 CPU, 102 ROM, 103 RAM, 104 control unit, 105 HDD, 106 external I / F, 107 input unit, 108 system bus

Claims

1. On the computer, A process of embedding classification explanation sentences written in natural language that explain the contents of two or more classifications, and generating two or more classification explanation sentence vectors; embedding target sentences in one or more natural languages ​​to generate one or more target sentence vectors; a process of calculating a plurality of similarities between each of the vectors of the two or more classification explanation sentences and each of the vectors of the one or more classification target sentences; a process of classifying the classification target sentence into one or more classifications in the two or more classification explanation sentences based on the plurality of similarities; A classification processing program that executes the above.

2. A process of calculating a quantum probability for each of the classification explanation sentences for each of the classification target sentences based on the plurality of similarities; The classification processing program according to claim 1 , further comprising: a process of classifying the classification target sentence into a category of classification explanation sentences exceeding a predetermined threshold based on the quantum probability.

3. The computer embedding two or more classification explanation sentences in natural language that explain the content of the classification, and generating a classification explanation sentence vector; embedding one or more natural language sentences to be classified to generate a classification sentence vector; calculating a plurality of similarities between each of the vectors of the two or more classification explanation sentences and each of the vectors of the one or more classification target sentences; A classification processing method for classifying the classification target text into one or more categories in the two or more category explanation texts based on the multiple similarities.

Citation Information

Patent Citations

  • Patent map generation program and method

    JP6586614B1