Classification processing program and method
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- 川上成年
- Filing Date
- 2025-07-12
- Publication Date
- 2026-04-10
AI Technical Summary
Existing text mining technologies face challenges in effectively classifying character strings written in natural language, particularly in identifying and categorizing problem and solution strings within patent data.
A classification processing program and method that utilizes a large-scale language model, such as OpenAI's GPT-4, to classify problem and solution strings from patent abstracts by extracting and categorizing them into predefined categories, followed by cross-tabulation and visualization of the results.
Enables accurate and efficient classification of natural language character strings, improving the precision of identifying and categorizing problem and solution strings within patent data, and generating a problem-solution map.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to a classification processing program. Reach and methods. [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: a process of extracting problem strings and solution strings from each of the abstract strings of multiple patent data; a process of inputting each of the multiple problem strings and problem classification instruction information including instructions to classify the multiple problem strings into one of multiple problem classifications expressed in natural language into a large-scale language model, and obtaining problem classification result information from the large-scale language model in which each of the multiple problem strings is classified into one of the multiple problem classifications expressed in natural language; and a process of inputting each of the multiple solution strings and solution classification instruction information including instructions to classify the multiple solution strings into one of multiple solution classifications expressed in natural language into the large-scale language model, and obtaining solution classification result information from the large-scale language model in which each of the multiple solution strings is classified into one of the multiple solution classifications expressed in natural language.
[0007] The present invention is a classification processing method in which a computer executes the following processes: a process of extracting problem strings and solution strings from each of the abstract strings of multiple patent data; a process of inputting each of the multiple problem strings and problem classification instruction information including instructions to classify the multiple problem strings into one of multiple problem classifications expressed in natural language into a large-scale language model, and obtaining problem classification result information in which each of the multiple problem strings is classified into one of the multiple problem classifications expressed in natural language from the large-scale language model; and a process of inputting each of the multiple solution strings and solution classification instruction information including instructions to classify the multiple solution strings into one of multiple solution classifications expressed in natural language into the large-scale language model, and obtaining solution classification result information in which each of the multiple solution strings is classified into one of the multiple solution classifications expressed in natural language from the large-scale language model.
[0008] The present invention is a classification processing method executed in a system in which a generation AI server that provides natural language processing using a large-scale language model and a terminal are connected via a network, in which the terminal transmits string information in a natural language and classification instruction information including classifications in multiple natural languages to the generation AI server, and the generation AI server classifies the string information in natural language into classifications in the multiple natural languages based on the classification instruction information and transmits the classification processing method to the terminal. [Effects of the Invention]
[0009] Classification processing program of the present invention Reach According to this method, it is possible to perform classification processing of character strings written in natural language. [Brief explanation of the drawings]
[0010] [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] Data frame containing the contents of the abstract [Figure 5] Data frame after STEP 1 processing [Figure 6] Data frame after processing in steps 2 and 3 [Figure 7] Generated graph [Figure 8] A data frame containing the review contents [Figure 9] Data frame after STEP 2 processing [Figure 10] Generated graph DETAILED DESCRIPTION OF THE INVENTION
[0011] Hereinafter, the classification processing program of the embodiment will be described. Reach The method and method will be described in detail with reference to the drawings.
[0012] 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 generation AI server 2 via a network.
[0013] The generation AI server 2 is a computer that classifies input character strings. In this embodiment, the generation AI server 2 is a generation AI server that provides cloud-based services incorporating large-scale language models, such as OpenAI's ChatGPT (both conversational services), GPT-4 Turbo, GPT-4, GPT-3.5 Turbo, GPT-3.5, and GPT-3 (all API services). The generation AI server 2 is not limited to these, and may also be a generation AI server that provides natural language processing services incorporating large-scale language models that provide similar functions (for example, Bard (both conversational services) and Gemini (all API services) developed by Google).
[0014] The generation AI server 2 of the embodiment has a CPU, memory, input / output devices, and an external interface, and performs natural language processing (classification processing in the embodiment) incorporating a large-scale language model in response to input from an external device, and outputs the result.
[0015] FIG. 2 is a block diagram of an information processing device (terminal 1) for executing the classification processing program of the embodiment.
[0016] 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.
[0017] 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.
[0018] 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.
[0019] 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.
[0020] The control unit 104 exchanges data with an external device (such as a generation AI server) via the external I / F 106 to obtain the Python library required to execute the program, send string data, and receive classification results.
[0021] 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.
[0022] (Embodiment 1: Patent Data Analysis) Next, the processing procedure of the classification processing program and method of the first embodiment will be explained. In the first embodiment, an example of creating a problem-solution map related to absorbent articles will be shown. The following code blocks 1 to 9 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 explained by dividing them into nine parts.
[0023] 3 is a flowchart of the classification processing program and method according to the embodiment. In STEP 1, problem and solution parts are extracted from the summary (character string information), in STEP 2 the extracted problems (first category classification) are classified, in STEP 3 the extracted solutions (second category classification) are classified, in STEP 4 cross-tabulation is performed for the classified problems and solutions, and in STEP 5 the tabulation results are visualized.
[0024] In the embodiment, patent data (abstract) is used as the character string to be processed, but the character string to be processed is not limited to this, and character strings within the specification text or claims may also be used, or character strings from surveys, user reviews, etc. other than patent data may also be processed.
[0025] (STEP 1: Identifying issues and solutions) First, the control unit 104 extracts problem character strings and solution character strings from the abstracts of multiple patent data. The program is as follows. The following program is a Python program stored in the control unit of the information processing device (terminal 1). However, other programming tools and programming languages may also be used. The following program is merely an example, and the processing order and the libraries, functions, and variable names used may be changed.
[0026] (Code Block 1) import pandas as pd from google.colab import drive drive.mount(' / content / drive') df = pd.read_excel(' / content / drive / MyDrive / patdata.xlsx') df['problem'] = df['summary'].str.extract('[issue](.+?)[solution]', expand=False) df['solution'] = df['summary'].str.extract('[Solution](.+?)[Selection]', expand=False)
[0027] A detailed explanation of this program is as follows. First, 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.
[0028] 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.
[0029] The control unit 104 uses the pd.read_excel function to read the Excel file patdata.xlsx located in the path ' / content / drive / MyDrive / patdata.xlsx'. This Excel file stores patent data that includes abstract data for multiple items. A portion of the data frame is shown in Figure 4. The summary column of the patent data stores the contents of the patent abstracts. Note that due to space constraints, Figure 4 only shows an example of three items (three rows), but in this embodiment, a data frame with 50 items (50 rows) is used. Of course, more items are possible.
[0030] The control unit 104 assigns the read file to a variable called df. df is a tabular data structure called a data frame. By specifying df['summary'], only the column called summary is extracted from df. The summary column stores the contents of the patent abstract written in natural language.
[0031] The control unit 104 uses the str.extract function to extract the string from "Problem" to "Solution" from the summary column. This string represents the patent problem (this is called problem string information). The extracted string is added to a new column called problem. A new column called problem is created in df by setting df['problem'] = ...
[0032] Similarly, the control unit 104 uses the str.extract function to extract the string from "Solution" to "Selection diagram" from the summary column. This string represents the solution of the patent (this is called solution string information). The extracted string is added to a new column called "solution." A new column called "solution" is created in df by setting df['solution'] = ...
[0033] Figure 5 shows a data frame to which the problem column and solution column have been added by the processing of STEP 1. Note that due to space limitations, only three items (three rows) are shown in Figure 5, but in this embodiment, a data frame consisting of 50 items (50 rows) is generated. Note that the character strings in the summary column are omitted because they were shown in Figure 4.
[0034] Note that the process of extracting the "problem" and "solution" strings from this summary is not mandatory. In other words, the entire summary can be sent as text information to the generation AI server as is and classified. However, by extracting and classifying the "problem" and "solution" strings separately, the classification accuracy of the generation AI server 2 can be improved, so it is preferable to include a process of extracting the "problem" and "solution" strings.
[0035] (STEP 2: Issue classification step) Next, the control unit 104 sends task classification instruction information including multiple task string information and multiple task classifications (classifications of the first category) to the generation AI server, and receives task classification result information from the generation AI server. The program is as follows.
[0036] (Code Block 2) ! pip install openai import openai import re
[0037] This command installs the OpenAI Python library. The ! indicates that the command should be interpreted as a shell command. pip is a Python package manager, and install is the command used to install libraries.
[0038] The control unit 104 imports Python libraries called openai and re. The openai library is for executing various natural language processing tasks using the OpenAI API, and the re library is for using regular expressions. Note that using the openai library actually requires input of an API key, but this is omitted from the program description because it would be difficult to make public.
[0039] (Code Block 3) def generate_p_class(text): response = openai.ChatCompletion.create( model="gpt-4", messages=[ {"role": "system", "content": "·Please assign one of the following five classifications to the text you enter: 'Leak-proof', 'Stuff-free', 'Easy to move in', 'Gentle on the skin', or 'Other'."}, {"role": "user", "content": text}]) p_class = response["choices"][0]["message"]["content"] return p_class
[0040] This program uses OpenAI's language model "GPT-4" to classify a given sentence into one of five categories. Note that the language model is not limited to "GPT-4," but can also be "GPT-4 Turbo," "GPT-3.5 Turbo," or the next version of the GPT series. These are known to demonstrate high accuracy in natural language processing tasks.
[0041] The generate_p_class(text) function receives one text (text) as an argument, and the control unit 104 calls OpenAI's Chat Completion API to classify the text. The API sends a message consisting of two roles, one for the system and one for the user, and the system sends an instruction saying, "Please assign one of the five categories of 'Leakproof', 'Movement-free', 'Gentle on the skin', and 'Other' to the next sentence you enter." This instruction information is called the task classification instruction information.
[0042] Note that 'leak-proof', 'non-sweating', 'easy to move in', 'gentle on the skin', and 'other' are classifications of tasks (classifications of the first category) made up of predetermined natural language. Furthermore, the expression of the task is not limited to '~', and other expressions may be used. Furthermore, the instructions (prompts) in natural language may be more detailed. Furthermore, although the embodiment instructs to classify into one category, instructions to classify into multiple categories may also be used. Furthermore, the number of categories is not limited to five, and may be more or less than five.
[0043] The generation AI server 2 classifies the given text (task string information) into the appropriate category based on the task classification instruction information and returns it. The response from the generation AI server 2 contains the classified category text (task classification result information). The task classification result information is stored in the p_class variable and returned as the function output.
[0044] (Code Block 4) def clean_text(text): text = re.sub(r'\s+', ' ', text) text = re.sub(r'[^\w\s]', '', text) return text
[0045] This program is a function that returns a string with special characters and extra spaces removed from the string (text) received as an argument. Specifically, it uses re (regular expression operations), a standard library of Python, to manipulate the string.
[0046] re.sub(r'\s+', ' ', text) replaces consecutive whitespace characters with a single whitespace character. \s represents a whitespace character, and + indicates that it can occur more than once. In other words, it replaces multiple whitespace characters with a single one.
[0047] Next, re.sub(r'[^\w\s]', '', text) removes any characters that are not alphanumeric or whitespace. [^\w\s] stands for any characters that are not alphanumeric or whitespace, and ^ stands for negation, so this means get rid of any characters that are not alphanumeric or whitespace.
[0048] Finally, return the cleaned string. return text indicates that the cleaned string is returned as the output of the function. Note that this code block 4 is not required.
[0049] (Code Block 5) df['p_class'] = df['problem'].apply(lambda x: generate_p_class(clean_text(x)))
[0050] This program cleans the text of each row stored in the problem column of the Pandas data frame df using the clean_text function, then generates a classification (p_class) using the generate_p_class function and adds the result to a new column p_class in df.
[0051] The control unit 104 uses the apply method to apply the clean_text function to the character strings in each row of the df['problem'] column to clean the text. lambda x: represents an argument to be applied to the clean_text function.
[0052] Next, the control unit 104 passes the cleaned sentence to the generate_p_class function, and assigns the result of classifying the sentence into one of the five categories to the df['p_class'] column. Finally, the data frame df including the new p_class column is returned, as shown in Figure 6.
[0053] (STEP 3: Solution classification step) Next, the control unit 104 sends the solution classification instruction information including multiple solution string information and multiple solution classifications (second category classifications) to the generation AI server, and receives the solution result information from the generation AI server. The program is as follows.
[0054] (Code Block 6) def generate_s_class(text): response = openai.ChatCompletion.create( model="gpt-4", messages=[ {"role": "system", "content": "·Please assign one of the following five classifications to the text you enter: 'Absorbent structure', 'Breathable structure', 'Skin-friendly structure', 'Fixed structure', or 'Other'."}, {"role": "user", "content": text}]) s_class = response["choices"][0]["message"]["content"] return s_class
[0055] This program is a function that uses OpenAI's GPT-4 (GPT-3.5 is also possible) to classify the structure of a sentence based on the string (text) received as an argument.
[0056] The generate_s_class(text) function receives one text (text) as an argument, and the control unit 104 calls OpenAI's Chat Completion API to classify the text. The API sends a message consisting of two roles, one for the system and one for the user, and the system sends an instruction saying, "Please assign one of the five classifications, 'absorbent structure,' 'breathable structure,' 'soft to the touch structure,' 'fixed structure,' or 'other,' to the next sentence you enter." This instruction information is used as solution means classification instruction information.
[0057] Note that 'absorbent structure', 'breathable structure', 'skin-friendly structure', 'fixed structure', and 'other' are classifications of solutions (classifications of the second category) made up of predetermined natural language. Furthermore, the expression of the solutions is not limited to "structure" and other expressions may be used. Furthermore, the instructions in natural language may be more detailed. Furthermore, although the embodiment instructs to classify into one of the categories, instructions to classify into multiple categories may also be used. Furthermore, the number of categories is not limited to five and may be more or less than five.
[0058] The generation AI server 2 classifies the given text (solution method string information) into the appropriate classification based on the solution method classification instruction information and returns it. The response from the generation AI server 2 contains the classified classification text (solution method classification result information). The solution method classification result information is stored in the s_class variable and returned as the output of the function.
[0059] The openai.ChatCompletion.create() method is used to make requests to the API. Messages sent to the API are given as a list with two elements. The first element is a message with the role system and represents the classification instructions. The second element is a message with the role user and represents the input text. When the API receives these messages, it generates and returns the appropriate classification. Finally, the classification result (s_class) is returned.
[0060] (Code Block 7) df['s_class'] = df['solution'].apply(lambda x: generate_s_class(clean_text(x)))
[0061] This program creates the s_class column by applying a function to classify the structure of each sentence in the solution column of the data frame df using OpenAI's GPT-4.
[0062] Specifically, the control unit 104 preprocesses each sentence included in df['solution'] using the clean_text function, and then classifies the sentence structure using the generate_s_class function, storing the results in the s_class column. Here, too, a function is applied to each sentence using a lambda expression.
[0063] The generate_s_class function uses the OpenAI API as explained above to classify the given text. Specifically, it prompts the user to assign one of the following classifications based on the structure contained in the text: 'absorbent structure', 'breathable structure', 'textured structure', 'fixed structure', or 'other'. Finally, as shown in Figure 6, the classification results for each solution method are stored in df['s_class'].
[0064] Figure 6 shows a data frame to which the p_class column and the s_class column have been added by the processing in steps 2 and 3. Note that due to space limitations, only 20 items (20 rows) are shown in Figure 6, but in this embodiment, a data frame df consisting of 50 items (50 rows) is generated. Also, the summary column, problem column, and solution column are omitted because they are already shown in Figures 4 and 5.
[0065] (STEP 4: Aggregation step) Next, the control unit 104 cross-tabulates the plurality of summaries (character string information) for each problem classification and solution classification. The program is as follows.
[0066] (Code Block 8) result = df.groupby(['p_class', 's_class']).size().reset_index(name='Counts')
[0067] In this program, the control unit 104 performs a so-called cross-tabulation, where data frames are grouped by p_class and s_class, and summaries are counted (aggregated) by problem classification and solution classification. This operation allows us to know the frequency of occurrence of solutions for each problem. (STEP 5: Visualization step) Next, the control unit 104 visualizes the counting results. The program is as follows.
[0068] (Code Block 9) ! pip install japanize-matplotlib import matplotlib.pyplot as plt import numpy as np import matplotlib.cm as cm import japanize_matplotlib y = result['p_class'].tolist() x = result['s_class'].tolist() sizes = [size * 100 for size in result['Counts'].tolist()] nums = [num for num in result['Counts'].tolist()] categories = list(set(y)) colors = cm.rainbow(np.linspace(0, 1, len(categories))) colors = {categories[i]: colors[i] for i in range(len(categories))} colors = [colors[item] for item in y] fig, ax = plt.subplots(figsize=[8,8]) ax.scatter(x, y, s=sizes, c=colors) for i, txt in enumerate(nums): ax.annotate(txt, (x[i], y[i]), textcoords="offset points", xytext=(0,0), ha='left', va='bottom') ax.set_xlabel("Solution means") ax.set_ylabel("Problem") ax.set_title("Problem - Solution means map") plt.xticks(rotation=90) plt.show()
[0069] This program creates a so-called problem-solution map. The control unit 104 creates a scatter plot using matplotlib. s_class is placed on the x-axis and p_class on the y-axis, and the size and color of each point are set based on the respective category. Specifically, the color corresponding to the y column value (problem category) of the grouped results is obtained from the color list generated by the rainbow color map. In addition, the count of the category represented by that point is displayed at each point.
[0070] Finally, the control unit 104 sets the style of the graph and displays the graph on a display device (not shown) such as a liquid crystal display connected via the external I / F 106 (FIG. 7). Note that the mapping may be done using other libraries such as seaborn instead of matplotlib, or cross-tabulation may be performed using the crosstab function and output in the form of a two-way table or heat map.
[0071] Furthermore, visualization is not limited to this, and it can also be a time series chart showing the relationship between the application date of the patent data and the above classification, or a line or bar graph showing the relationship between the patent data applicant and the above classification.By using matplotlib, various forms of visualization are possible.
[0072] (Embodiment 2: Survey Analysis) Next, the processing procedure of the classification processing program and method of the second embodiment will be explained. In the second embodiment, an example is shown in which user reviews of a vacuum cleaner are classified, tabulated, and visualized. The following code blocks 1 to 6 are connected in series to form the program and method of the embodiment, and should basically be written consecutively. However, for ease of explanation, the explanation will be divided into six parts.
[0073] In the processing of the classification processing program and method of the second embodiment, in STEP 1, user reviews are classified, in STEP 2 the classified user reviews are tallied, and in STEP 3 the tallied results are visualized (flowchart omitted).
[0074] (STEP 1: Classification step) First, the control unit 104 creates a data frame from multiple user reviews. The program is as follows. The following program is a Python program stored in the control unit of the information processing device (terminal 1). However, other programming tools and programming languages may also be used. The following program is merely an example, and the processing order and the libraries, functions, and variable names used may be changed.
[0075] (Code Block 1) import pandas as pd from google.colab import drive drive.mount(' / content / drive') df = pd.read_excel(' / content / drive / MyDrive / reviewdata.xlsx')
[0076] A detailed explanation of this program is as follows. First, 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.
[0077] 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.
[0078] The control unit 104 uses the pd.read_excel function to read an Excel file called reviewdata.xlsx located in the path ' / content / drive / MyDrive / reviewdata.xlsx'. This Excel file stores multiple user reviews. A portion of the data frame is shown in Figure 8. The review column of the review data stores the contents of the user reviews. Note that due to space constraints, Figure 8 only shows an example of three items (three rows), but in this embodiment, a data frame with 100 items (100 rows) is used. Of course, more items are possible.
[0079] The control unit 104 assigns the read file to a variable called df. df is a tabular data structure called a data frame. By specifying df['review'], only the column called review is extracted from df. The review column stores the content of user reviews written in natural language (review string information).
[0080] Next, the control unit 104 transmits the needs classification instruction information including the multiple review string information and the multiple needs classifications to the generation AI server, and receives the needs classification result information from the generation AI server. The program is as follows.
[0081] (Code Block 2) ! pip install openai import openai
[0082] This command installs the OpenAI Python library. The ! indicates that the command should be interpreted as a shell command. pip is a Python package manager, and install is the command used to install libraries.
[0083] The control unit 104 imports a Python library called openai. The openai library is used to execute various natural language processing tasks using the OpenAI API. Note that, although input of an API key is actually required to use the openai library, this is omitted from the program description because it would be difficult to make it public.
[0084] (Code Block 3) def generate_n_class(text): response = openai.ChatCompletion.create( model="gpt-4", messages=[ {"role": "system", "content": "·Please classify the following sentence into one of the following 10 categories: 'A pleasant feeling of cleanliness', 'A feeling of reduced effort', 'Improved efficiency of housework', 'Reliable hygiene management', 'Stress-free operation', 'Pride in one's home', 'Satisfaction with ease of use', 'Comfortable living environment', 'Satisfaction with time savings', 'Confidence in making a wise choice'."}, {"role": "user", "content": text}]) n_class = response["choices"][0]["message"]["content"] return n_class
[0085] This program uses OpenAI's language model "GPT-4" to translate a given sentence into 10 It provides a function to classify a language model into one of the following categories. Note that the language model is not limited to "GPT-4," but may be "GPT-4 Turbo," "GPT-3.5 Turbo," or the next version of the GPT series. These are known to demonstrate high accuracy in natural language processing tasks.
[0086] The generate_n_class(text) function receives a single text (text) as an argument, and the control unit 104 calls OpenAI's Chat Completion API to classify the text. The API sends a message consisting of two roles, one for the system and one for the user, and the system sends an instruction saying, "For the next sentence to be entered, please assign one of the following 10 classifications: 'Comfortable cleanliness,' 'Reduced effort,' 'Improved housework efficiency,' 'Reliable hygiene management,' 'Stress-free operation,' 'Pride in home,' 'Satisfaction with ease of use,' 'Comfortable living environment,' 'Satisfaction with time savings,' and 'Confidence in making wise choices.'" This instruction information is used as needs classification instruction information.
[0087] Note that 'comfortable cleanliness', 'effort reduction', 'improved housework efficiency', 'safe hygiene management', 'stress-free operation', 'pride in one's home', 'satisfaction with ease of use', 'comfortable living environment', 'fulfillment from time savings', and 'confidence in making wise choices' are categories of needs in predetermined natural language. Other expressions may be used to express the needs. The prompts may be more detailed. While the embodiment instructs to classify items into one category, the prompts may also be used to classify items into multiple categories. The number of categories is not limited to 10 and may be more or less than 10.
[0088] The generation AI server 2 classifies the given text (needs string information) into the appropriate category based on the needs classification instruction information and returns it. The response from the generation AI server 2 contains the classified category text (needs classification result information). The needs classification result information is stored in the n_class variable and returned as the output of the function.
[0089] (Code Block 4) df['n_class'] = df['review'].apply(lambda x: generate_n_class(x))
[0090] This program processes each row of text stored in the review column of the Pandas data frame df using the generate_n_class function, generates a classification (n_class), and adds the resulting classification to a new column n_class in df.
[0091] The control unit 104 uses the apply method to add lambda x: to the character strings in each row of the df['review'] column, which indicates an argument to be applied to x.
[0092] The control unit 104 passes the text to the generate_n_class function, classifies the text into one of the 10 categories, and assigns the result to the df['n_class'] column. Finally, the data frame df including the new n_class column is returned, as shown in FIG.
[0093] Figure 9 shows a data frame to which the n_class column has been added by the processing of STEP 2. Note that due to space limitations, only 20 items (20 rows) are shown in Figure 9, but in this embodiment, a data frame df consisting of 100 items (100 rows) is generated. Also, the review column is omitted because it was shown in Figure 8.
[0094] (STEP 2: Aggregation step) Next, the control unit 104 performs a process of tallying up a plurality of reviews (character string information) for each of a plurality of categories (needs categories) based on the classification result information (needs classification result).
[0095] (Code Block 5) df_n_class_counts = df['n_class'].value_counts().sort_index().reset_index() df_n_class_counts.columns = ["Need Classification", "Count"]
[0096] df['n_class'].value_counts(): This part calculates the frequency of values in the column called n_class of the dataframe df. The value_counts() function counts how often different values appear in a dataframe and returns a new dataframe or series with those frequencies.
[0097] .sort_index(): This method sorts the obtained frequency data based on the index (here the n_class value). This is used to re-sort based on the original value (n_class) since by default it is sorted based on the frequency of the values.
[0098] .reset_index(): This method resets the index and converts the existing index to a regular column, which keeps the original index (n_class value) as a column in the new DataFrame.
[0099] df_n_class_counts.columns = ["Need Class", "Count"]: Finally, we rename the columns in the newly created data frame df_n_class_counts. We name the first column (which contains the original n_class values) "Need Class", and the second column with frequency values "Count". (STEP 3: Visualization step) Next, the control unit 104 visualizes the counting results. The program is as follows.
[0100] (Code Block 6) ! pip install japanize-matplotlib import matplotlib.pyplot as plt import japanize_matplotlib plt.figure(figsize=(10, 6)) plt.plot(df_n_class_counts['Needs classification'], df_n_class_counts['Number of cases']) plt.title('Number of items by need category') plt.xlabel('Needs classification') plt.ylabel('number of items') plt.show()
[0101] !pip install japanize-matplotlib: This is the command to install the japanize-matplotlib package, which is used to display Japanese characters correctly in matplotlib.
[0102] import matplotlib.pyplot as plt: Here, we import the matplotlib pyplot module with the name plt.
[0103] import japanize_matplotlib: This line imports the japanize-matplotlib library that you installed earlier.
[0104] plt.figure(figsize=(10, 6)): This specifies the size of the graph. Here, we create a figure (graph) that is 10 inches wide and 6 inches high.
[0105] plt.plot(df_n_class_counts['Needs Classification'], df_n_class_counts['Number of Cases']): This line plots the Needs Classification column of the df_n_class_counts data frame on the x-axis and the Number of Cases column on the y-axis. This will display the relationship between Needs Classification and Number of Cases in a line chart.
[0106] plt.title('Number of items by need category'): Here we set the title for the graph. The title will be "Number of items by need category".
[0107] plt.xlabel('Needs Classification') and plt.ylabel('Number of Items'): These lines set labels for the x-axis and y-axis, respectively. The x-axis label is "Needs Classification" and the y-axis label is "Number of Items".
[0108] plt.show(): Finally, this line displays the graph created by matplotlib. This will display the graph on the screen based on the settings above.
[0109] The control unit 104 displays a graph on a display device (not shown) such as a liquid crystal display connected via the external I / F 106 (FIG. 10).
[0110] The visualization is not limited to this and can also be a bar graph. Various forms of visualization are possible using matplotlib.
[0111] In the above embodiment, processing using Python was described, but this is not limited to this, and similar processing can also be performed by combining a spreadsheet such as Excel with ChatGPT or an API.
[0112] Furthermore, the classification categories are not limited to problems and solutions or needs, but may be classified into categories based on natural language, such as quality, effect, use, and benefit, depending on the purpose of the analysis. Furthermore, the character strings to be classified are not limited to patent data, and can be any character strings based on natural language, such as those found in research papers.
[0113] 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]
[0114] 1 terminal, 2 generation AI server, 101 CPU, 102 ROM, 103 RAM, 104 control unit, 105 HDD, 106 external I / F, 107 input unit, 108 system bus
Claims
1. A computer, The process involves inputting into a large-scale language model each of several strings relating to a specific object, and first classification instruction information that lists several first category classifications expressed in natural language according to the object and purpose of analysis, and instructs the model to assign one of these first category classifications, and then obtaining first classification result information from the large-scale language model in which each of the several strings is classified into one of the several first category classifications expressed in natural language. The large-scale language model is input to each of the multiple strings and to a second classification instruction information that lists a plurality of second category classifications expressed in a plurality of natural languages set according to the target and purpose of analysis, and instructs the model to assign one of the second category classifications; and the large-scale language model is used to obtain second classification result information in which each of the multiple strings is classified into one of the plurality of second category classifications expressed in the plurality of natural languages. A classification processing program that executes the following.
2. The classification processing program according to claim 1, further performing a process to cross-tabulate each of the plurality of strings for each of the first category classification and the second category classification based on the first classification result information and the second classification result information, and to visualize the tabulation results.
3. Each of the plurality of strings is a substring extracted from a plurality of document data strings relating to a specific object, The classification processing program according to claim 1 or 2, which causes the computer to further perform a process of extracting the substring from each of the strings of the plurality of document data.
4. The classification processing program according to claim 3, wherein the plurality of document data are abstracts of a plurality of patent data, the substring is a problem string and a solution string, the first category classification is a problem classification, and the second category classification is a solution classification.
5. A computer, The process involves inputting into a large-scale language model each of several strings relating to a specific object, and first classification instruction information that lists several first category classifications expressed in natural language according to the object and purpose of analysis, and instructs the model to assign one of these first category classifications, and then obtaining first classification result information from the large-scale language model in which each of the several strings is classified into one of the several first category classifications expressed in natural language. The large-scale language model is input to each of the multiple strings and to a second classification instruction information that lists a plurality of second category classifications expressed in a plurality of natural languages set according to the target and purpose of analysis, and instructs the model to assign one of the second category classifications; and the large-scale language model is used to obtain second classification result information in which each of the multiple strings is classified into one of the plurality of second category classifications expressed in the plurality of natural languages. A classification processing method that performs this task.