Data processing method and related device
By determining and using specific prompt Prompts in large language models, the problems of not high language analysis efficiency and accuracy in existing technologies are solved, and the efficient and accurate treatment of vertical language analysis is realized.
Patent Information
- Application Number
- PCT/CN2024/105683
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-20
- Filing Date
- 2024-07-16
- Publication Date
- 2025-01-23
AI Technical Summary
When using language models to conduct professional vertical language analysis, the prior art lacks the ability to connect the connotation and extension of vertical concepts, resulting in low analysis efficiency and accuracy.
By obtaining the text and judgment content that needs to be judged, determine the corresponding prompts, guide the description of the entity in the text in the text to identify the text, and make the text judgment based on these descriptions to improve the efficiency and accuracy of language analysis.
The efficient and precise treatment of the analysis of vertical domain language improves the understanding and connection of the concept of vertical domain.
Smart Images

Figure CN2024105683_23012025_PF_FP_ABST
Abstract
Description
A data processing method and related device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on July 20, 2023, with application number 202310901078.X and invention name “A data processing method and related device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of artificial intelligence, and in particular to a data processing method and related devices. Background Art
[0003] Artificial intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0004] The explosion of large-scale language models demonstrates that they can demonstrate near-human communication and logical reasoning capabilities based on large-scale corpus data. Currently, large-scale language models have achieved breakthroughs in various text and context modeling tasks, providing new interfaces for human-computer interaction and ushering in a new technological revolution.
[0005] When the basic model is directly applied to professional vertical domains, it only has general semantic understanding capabilities, and lacks the ability to connect the connotation and extension of vertical domain concepts (such as law, medical care, etc.) and the relationship between different legal concepts; for different vertical domain concepts, different NLP capabilities need to be called for processing, which requires additional input management.
[0006] Therefore, there is an urgent need for a more efficient vertical language analysis method using language models.
[0007] Summary of the Invention
[0008] This application provides a data processing method that can improve the efficiency and accuracy of language analysis.
[0009] In a first aspect, the present application provides a data processing method, comprising: obtaining a first text and a second text; the first text is the text to be judged; the second text is the content of the judgment on the first text; according to the entities included in the second text, determining a first prompt and a second prompt, the first prompt indicating the description of each entity in the first text; the second prompt indicating the judgment of the first text indicated by the second text according to the description of each entity; according to the first text, the first prompt and the second prompt, through a language model, obtaining the judgment result of the first text.
[0010] This application uses a first prompt to guide the language model to identify the interpretation of the entity in the first text, uses the language model to automatically decompose the task of understanding the elements into prompts for input of NLP tasks, and uses the prompt to guide the language model to use the description of the entity to make text judgments, thereby improving the efficiency and accuracy of language analysis.
[0011] In a possible implementation, determining the first prompt and the second prompt according to the entity included in the second text includes: determining the first prompt and the second prompt through a language model according to the entity included in the second text.
[0012] In one possible implementation, the method further includes:
[0013] Obtain a third text, wherein the third text is a judgment content of the first text; determine, based on the third text, through a language model, that the third text includes an abstract entity; and obtain the second text based on the third text and an interpretation of the abstract object received from the user input.
[0014] In a possible implementation, the method further includes: obtaining a description of each entity based on the first text and the first prompt through a language model, and constructing the second prompt based on the description of each entity.
[0015] In a possible implementation, the first text includes a case description; the second text includes legal elements; or, the first text includes a condition description; the second text includes medical elements.
[0016] In a second aspect, the present application provides a data processing device, comprising:
[0017] An acquisition module is configured to acquire a first text and a second text; the first text is the text to be judged; the second text is the judgment content of the first text;
[0018] A processing module is used to determine a first prompt and a second prompt based on entities included in the second text, wherein the first prompt indicates the description of identifying each entity in the first text; the second prompt indicates the determination of the second text indication for the first text based on the description of each entity; and based on the first text, the first prompt and the second prompt, a determination result of the first text is obtained through a language model.
[0019] In a possible implementation, the processing module is specifically configured to:
[0020] According to the entities included in the second text, a first prompt and a second prompt are determined through a language model.
[0021] In a possible implementation, the acquisition module is further configured to:
[0022] Acquire a third text, where the third text is a judgment content of the first text;
[0023] The processing module is further configured to determine, based on the third text and using a language model, that the third text includes an abstract entity; and obtain the second text based on the third text and an interpretation of the abstract object received from the user input.
[0024] In a possible implementation, the processing module is further configured to obtain a description of each entity based on the first text and the first prompt through a language model, and construct the second prompt based on the description of each entity.
[0025] In a possible implementation, the first text includes a case description; the second text includes legal elements; or, the first text includes a condition description; the second text includes medical elements.
[0026] In a third aspect, an embodiment of the present application provides a data processing device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute the programs in the memory to perform any optional method as described in the first aspect above.
[0027] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned first aspect and any optional method.
[0028] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising code, which, when executed, is used to implement the above-mentioned first aspect and any optional method.
[0029] In a sixth aspect, the present application provides a chip system comprising a processor configured to support a data processing device in implementing the functions described in the aforementioned aspects, such as transmitting or processing data or information described in the aforementioned methods. In one possible design, the chip system further comprises a memory configured to store program instructions and data necessary for executing or training the device. The chip system may consist solely of a chip or may include a chip and other discrete components. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1A is a schematic diagram of a structure of an artificial intelligence main framework;
[0031] FIG1B is a schematic diagram of a system architecture provided in an embodiment of the present application;
[0032] FIG1C is a schematic diagram of a system architecture provided in an embodiment of the present application;
[0033] FIG1D is a schematic diagram of a system architecture provided in an embodiment of the present application;
[0034] FIG2 is a schematic diagram of a system architecture provided in an embodiment of the present application;
[0035] FIG3 is a schematic diagram of a system architecture provided in an embodiment of the present application;
[0036] FIG4 is a schematic diagram of a cloud service provided by an embodiment of the present application;
[0037] FIG5 is a flow chart of a data processing method provided in an embodiment of the present application;
[0038] FIG6 is a flow chart of a data processing method provided in an embodiment of the present application;
[0039] FIG7 is a schematic structural diagram of a data processing device provided in an embodiment of the present application;
[0040] FIG8 is a schematic diagram of a terminal device provided in an embodiment of the present application;
[0041] FIG9 is a schematic diagram of a server provided in an embodiment of the present application;
[0042] FIG10 is a schematic diagram of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The following describes the embodiments of the present invention in conjunction with the accompanying drawings. The terms used in the embodiments of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.
[0044] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0045] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0046] First, let's describe the overall workflow of an AI system. See Figure 1A, which shows a schematic diagram of the main AI framework. This AI framework will be explained from two perspectives: the "intelligent information chain" (horizontal axis) and the "IT value chain" (vertical axis). The "intelligent information chain" reflects the entire process from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. Throughout this process, data undergoes a condensed journey from "data-information-knowledge-wisdom." The "IT value chain," spanning the underlying infrastructure of human intelligence, information (provided and processed by technology), and the system's industrial ecosystem, reflects the value that AI brings to the information technology industry.
[0047] (1) Infrastructure
[0048] Infrastructure provides computing power for AI systems, enabling communication with the outside world and supporting this through a foundational platform. External communication occurs through sensors; computing power is provided by intelligent chips (CPUs, NPUs, GPUs, ASICs, FPGAs, and other hardware accelerators). The foundational platform includes a distributed computing framework and network-related platform guarantees and support, including cloud storage and computing, and interconnected networks. For example, sensors communicate with the outside world to acquire data, which is then fed into the intelligent chips within the distributed computing system provided by the foundational platform for computation.
[0049] (2) Data
[0050] Data above the infrastructure layer represents data sources for AI. This data includes graphics, images, voice, and text, as well as IoT data from traditional devices. This includes business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.
[0051] (3) Data processing
[0052] Data processing generally includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
[0053] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0054] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.
[0055] Decision-making refers to the process of making decisions after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
[0056] (4) General ability
[0057] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0058] (5) Smart products and industry applications
[0059] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical application. Its application areas mainly include: smart terminals, smart transportation, smart medical care, autonomous driving, smart cities, etc.
[0060] The present application can be applied in the field of photography. The application scenarios of the embodiments of the present application are introduced below.
[0061] First, the application scenarios of this application are introduced. This application can be applied to, but is not limited to, language analysis functions with vertical domains or cloud services provided by cloud-side servers.
[0062] Next, the vertical domain language analysis application in the embodiment of this application is introduced from the functional architecture and the product architecture that implements the functions.
[0063] Referring to FIG. 1B , FIG. 1B is a schematic diagram of the functional architecture of a language analysis application for a vertical domain in an embodiment of the present application:
[0064] In one possible implementation, as shown in FIG1B , a vertical domain language analysis application 102 may receive parameters 101 (e.g., text requiring language determination and determination content) and generate processing results 103 (e.g., determination results). The vertical domain language analysis application 102 may be executed on (for example) at least one computer system and include computer code that, when executed by one or more computers, causes the computers to execute methods provided by embodiments of the present application.
[0065] Referring to FIG. 1C , FIG. 1C is a schematic diagram of the entity architecture of a language analysis application running a vertical domain in an embodiment of the present application:
[0066] Referring to Figure 1C, Figure 1C shows a schematic diagram of a system architecture. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers (Figure 1C illustrates one server as an example), and the server 200 may provide a vertical domain language analysis function for one or more terminals.
[0067] Among them, the terminal 100 may be installed with a vertical domain language analysis application, which may provide an interface. The terminal 100 may receive relevant parameters (e.g., parameter 101) input by the user and send the parameters to the server 200. The server 200 may obtain a processing result (e.g., a determination result) based on the received parameters and return the processing result to the terminal 100. The terminal 100 may use the processing result 103 to shoot and obtain a shooting result.
[0068] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the need for the cooperation of the server, and the embodiments of the present application are not limited to this.
[0069] Next, the product form of the terminal 100 in FIG1C is described;
[0070] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this.
[0071] FIG1D shows a schematic diagram of an optional hardware structure of the terminal 100 .
[0072] 1D , the terminal 100 may include components such as a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), a processor 170, an external interface 180, and a power supply 190. Those skilled in the art will appreciate that FIG1D is merely an example of a terminal or multi-function device and does not limit the terminal or multi-function device. The terminal or multi-function device may include more or fewer components than shown, or may combine certain components or have different components.
[0073] The input unit 130 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the portable multifunction device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can detect user touch operations on or near it (for example, operations performed on or near the touch screen using a finger, joint, stylus, or any other suitable object) and drive corresponding connected devices according to pre-set programs. The touch screen can detect user touch actions on the touch screen, convert the touch actions into touch signals and transmit them to the processor 170. It can also receive and execute commands sent by the processor 170; the touch signals include at least touch point coordinate information. The touch screen 131 provides an input interface and an output interface between the terminal 100 and the user. Touch screens can be implemented using various types, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch screen 131, the input unit 130 may also include other input devices. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0074] The other input device 132 may receive input text requiring language determination and determination content.
[0075] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In an embodiment of the present application, the display unit 140 can be used to display the interface and processing results of a language analysis application in the vertical domain.
[0076] Memory 120 can be used to store instructions and data. It primarily includes an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files and text. The instruction storage area can store software units such as the operating system, applications, and instructions required for at least one function, or subsets or extensions thereof. It may also include non-volatile random access memory (RAM). It provides processor 170 with management functions for the hardware, software, and data resources within the computing and processing device, supporting control software and applications. It is also used to store multimedia files and running programs and applications.
[0077] The processor 170 is the control center of the terminal 100. It connects all components of the terminal 100 using various interfaces and circuits. By executing instructions stored in the memory 120 and accessing data stored therein, it executes various functions of the terminal 100 and processes data, thereby providing overall control of the terminal device. Optionally, the processor 170 may include one or more processing units. Preferably, the processor 170 may integrate an application processor and a modem processor, with the application processor primarily processing the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory may be implemented on a single chip; in other embodiments, they may be implemented on separate chips. The processor 170 may also generate corresponding operational control signals and send them to the corresponding components of the computing and processing device. It may also read and process data in the software, particularly the data and programs in the memory 120, to enable the various functional modules therein to perform their corresponding functions, thereby controlling the corresponding components to operate as instructed.
[0078] Among them, the memory 120 can be used to store software codes related to the data processing method, the processor 170 can execute the steps of the chip's data processing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve corresponding functions.
[0079] The RF unit 110 (optional) can be used to send and receive information or receive and send signals during a call. For example, after receiving downlink information from the base station, it is passed to the processor 170 for processing; in addition, it sends the designed uplink data to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF unit 110 can also communicate with network devices and other devices via wireless communication. This wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0080] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0081] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0082] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to other devices for communication, or to connect a charger to charge the terminal 100 .
[0083] Although not shown, the terminal 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied to the terminal 100 shown in FIG1D .
[0084] Next, the product form of the server 200 in FIG1C is described;
[0085] FIG2 provides a schematic diagram of the structure of a server 200. As shown in FIG2, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0086] Bus 201 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, FIG2 shows only one thick line, but this does not imply that there is only one bus or only one type of bus.
[0087] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0088] The memory 204 may include volatile memory, such as random access memory (RAM). The memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard drive (HDD), or solid state drive (SSD).
[0089] The memory 204 may be used to store software codes related to the data processing method, and the processor 202 may execute the steps of the data processing method of the chip, and may also schedule other units to implement corresponding functions.
[0090] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0091] It should be understood that the steps related to the model reasoning process in the embodiments of this application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and server is not limited to the processor-memory architecture described above. The system architecture provided in the embodiments of this application is described in detail below with reference to Figure 3.
[0092] FIG3 is a schematic diagram of the system architecture provided by an embodiment of the present application. As shown in FIG3 , the system architecture 500 includes an execution device 510 , a training device 520 , a database 530 , a client device 540 , a data storage system 550 , and a data acquisition system 560 .
[0093] The execution device 510 includes a calculation module 511, an I / O interface 512, a pre-processing module 513, and a post-processing module 514. The calculation module 511 may include the target model / rule 501, and the pre-processing module 513 and the post-processing module 514 are optional.
[0094] Among them, the execution device 510 can be a terminal device that runs the above-mentioned vertical domain language analysis application.
[0095] The data collection device 560 is used to collect training samples. After collecting the training samples, the data collection device 560 stores these training samples in the database 530.
[0096] The training device 520 can train the neural network based on the training samples maintained in the database 530 to obtain the target model / rule 501.
[0097] It should be understood that the training device 520 can perform a pre-training process on the neural network to be trained based on the training samples maintained in the database 530, or fine-tune the model based on the pre-training.
[0098] It should be noted that, in actual applications, the training samples maintained in the database 530 may not all be collected by the data acquisition device 560, but may also be received from other devices. It should also be noted that the training device 520 may not train the target model / rule 501 entirely based on the training samples maintained in the database 530, but may also obtain training samples from the cloud or other places for model training. The above description should not be used as a limitation on the embodiments of the present application.
[0099] The target model / rule 501 (for example, the language model in the embodiment of the present application) obtained through training by the training device 520 can be applied to different systems or devices, such as the execution device 510 shown in Figure 3. The execution device 510 can be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR) device, a vehicle-mounted terminal, etc., and can also be a server, etc.
[0100] Specifically, the training device 520 may transfer the trained model to the execution device 510 .
[0101] In Figure 3, the execution device 510 is configured with an input / output (I / O) interface 512 for data interaction with external devices. The user can input data (such as the text that needs to be language determined and the determination content in the embodiment of the present application) into the I / O interface 512 through the client device 540.
[0102] Preprocessing module 513 and preprocessing module 514 are used to preprocess the input data received by I / O interface 512. It should be understood that preprocessing module 513 and preprocessing module 514 may be absent or only one preprocessing module may be present. If preprocessing module 513 and preprocessing module 514 are absent, computing module 511 may be used directly to process the input data.
[0103] When the execution device 510 preprocesses the input data, or when the computing module 511 of the execution device 510 performs calculations and other related processing, the execution device 510 can call the data, code, etc. in the data storage system 550 for corresponding processing, and can also store the data, instructions, etc. obtained from the corresponding processing in the data storage system 550.
[0104] Finally, the I / O interface 512 provides the processed results to the client device 540 and thus to the user.
[0105] In the scenario shown in FIG3 , the user can manually input data, and this "manual input data" can be operated through the interface provided by I / O interface 512. In another scenario, client device 540 can automatically send input data to I / O interface 512. If user authorization is required for client device 540 to automatically send input data, the user can set the corresponding permissions in client device 540. The user can view the results output by execution device 510 on client device 540, and the specific presentation form can be a display, sound, action, or other specific method. Client device 540 can also serve as a data acquisition terminal, collecting input data input into I / O interface 512 and output results output from I / O interface 512 as new sample data, and storing them in database 530. Of course, collection can also be performed without client device 540, and instead the I / O interface 512 directly stores the input data input into I / O interface 512 and output results output from I / O interface 512 as new sample data in database 530.
[0106] It is worth noting that FIG3 is merely a schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationships between the devices, components, modules, etc. shown in the figure do not constitute any limitation. For example, in FIG3 , the data storage system 550 is an external memory relative to the execution device 510. In other cases, the data storage system 550 can also be placed in the execution device 510. It should be understood that the execution device 510 can be deployed in the client device 540.
[0107] From the inference side of the model:
[0108] In the embodiment of the present application, the computing module 511 of the above-mentioned execution device 520 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in the embodiment of the present application.
[0109] In an embodiment of the present application, the computing module 511 of the execution device 520 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0110] Specifically, the computing module 511 of the execution device 520 can be a hardware system with the function of executing instructions, and the steps related to the model reasoning process provided in the embodiment of the present application can be software codes stored in the memory. The computing module 511 of the execution device 520 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model reasoning process provided in the embodiment of the present application.
[0111] It should be understood that the computing module 511 of the execution device 520 can be a combination of a hardware system that does not have the function of executing instructions and a hardware system that has the function of executing instructions. Some of the steps related to the model reasoning process provided in the embodiment of the present application can also be implemented by the hardware system that does not have the function of executing instructions in the computing module 511 of the execution device 520, which is not limited here.
[0112] From the training side of the model:
[0113] In an embodiment of the present application, the above-mentioned training device 520 can obtain the code stored in the memory (not shown in Figure 3, which can be integrated into the training device 520 or deployed separately from the training device 520) to implement the steps related to model training in the embodiment of the present application.
[0114] In an embodiment of the present application, the training device 520 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0115] It should be understood that the training device 520 can be a combination of a hardware system that does not have the function of executing instructions and a hardware system that has the function of executing instructions. Some of the steps related to model training provided in the embodiments of the present application can also be implemented by the hardware system in the training device 520 that does not have the function of executing instructions, which is not limited here.
[0116] This application can also be applied to vertical domain language analysis cloud services provided by the server:
[0117] In one possible implementation, the server may provide a vertical domain language analysis function service to the terminal side through an application programming interface (API).
[0118] Among them, the terminal device can send relevant parameters (such as the text that needs to be language determined and the determination content) to the server through the API provided by the cloud. The server can obtain processing results based on the received parameters, etc., and return the processing results to the terminal.
[0119] The description of the terminal and the server can be the same as that of the above embodiments, and will not be repeated here.
[0120] FIG4 shows the process of using a vertical domain language analysis function cloud service provided by a cloud platform.
[0121] 1. Activate and purchase content review services.
[0122] 2. Users can download the software development kit (SDK) corresponding to the content review service. Usually, the cloud platform provides multiple development versions of the SDK for users to choose according to the requirements of the development environment, such as JAVA version SDK, Python version SDK, PHP version SDK, Android version SDK, etc.
[0123] 3. After the user downloads the corresponding version of the SDK to the local computer as needed, the SDK project is imported into the local development environment for configuration and debugging. The local development environment can also be used to develop other functions, forming an application that integrates vertical language analysis functional capabilities.
[0124] 4. When using a vertical domain language analysis application, if the vertical domain language analysis function is needed, an API call for the vertical domain language analysis function can be triggered. When the application triggers the vertical domain language analysis function, an API request is initiated to the running instance of the vertical domain language analysis function service in the cloud environment. The API request contains the text for which language determination is required and the determination content. The running instance in the cloud environment processes the image and obtains the processing result.
[0125] 5. The cloud environment returns the processing results to the application, thereby completing a call to the vertical domain language analysis function.
[0126] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and related concepts such as neural networks involved in the embodiments of the present application are first introduced below.
[0127] (1) Neural Network
[0128] A neural network can be composed of neural units. A neural unit can refer to an operation unit that takes xs (i.e., input data) and intercept 1 as input. The output of the operation unit can be:
[0129] Where s = 1, 2, ... n, n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal of the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field. The local receptive field can be an area composed of several neural units.
[0130] (2) Natural language processing (NLP)
[0131] Natural language refers to human language, and natural language processing (NLP) is the processing of human language. Natural language processing is the process of systematically analyzing, understanding, and extracting information from text data in an intelligent and efficient manner. By using NLP and its components, we can manage very large amounts of text data, perform a large number of automated tasks, and solve a wide variety of problems, such as automatic summarization, machine translation (MT), named entity recognition (NER), relation extraction (RE), information extraction (IE), sentiment analysis, speech recognition, question answering, and topic segmentation.
[0132] (3) Deep Neural Networks
[0133] Deep Neural Network (DNN), also known as multi-layer neural network, can be understood as a neural network with many hidden layers. There is no special metric for "many" here. Based on the position of different layers in DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, the work of each layer is actually not complicated. Simply put, it is the following linear relationship expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since there are many DNN layers, the coefficient W and the offset vector The definition of these parameters in DNN is as follows: Take the coefficient W as an example: Assume that in a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as The superscript 3 represents the layer number of the coefficient W, while the subscript corresponds to the output of the third layer index 2 and the input of the second layer index 4. In summary, the coefficient from the kth neuron in the L-1th layer to the jth neuron in the Lth layer is defined as It's important to note that the input layer has no W parameter. In deep neural networks, more hidden layers allow the network to better capture complex real-world situations. Theoretically, a model with more parameters has higher complexity and greater "capacity," meaning it can handle more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrices for all layers of a trained deep neural network (a weight matrix formed by the vectors W across many layers).
[0134] (4) Prompt
[0135] A natural language term that can be categorized into hard templates and soft templates. Hard templates are generally natural language words or sentences with a specific meaning; soft templates are generally parameterized representation vectors without any meaning.
[0136] The explosion of large-scale language models demonstrates that they can demonstrate near-human communication and logical reasoning capabilities based on large-scale corpus data. Currently, large-scale language models have achieved breakthroughs in various text and context modeling tasks, providing new interfaces for human-computer interaction and ushering in a new technological revolution.
[0137] When the basic model is directly applied to professional vertical domains, it only has general semantic understanding capabilities, and lacks the ability to connect the connotation and extension of vertical domain concepts (such as law, medical care, etc.) and the relationship between different legal concepts; for different vertical domain concepts, different NLP capabilities need to be called for processing, which requires additional input management.
[0138] Therefore, there is an urgent need for a more efficient vertical language analysis method using language models.
[0139] In order to solve the above problems, the present application provides a data processing method, which can be a training process of a model, for example, a pre-training process or a fine-tuning process of the model.
[0140] 5 , which is a schematic diagram of an embodiment of a data processing method provided in an embodiment of the present application, as shown in FIG5 , a data processing method provided in an embodiment of the present application includes:
[0141] 501. Obtain a first text and a second text; the first text is the text to be judged; the second text is the judgment content of the first text.
[0142] In some scenarios, it is necessary to determine whether the first text matches the information indicated by the second text.
[0143] The first text may be a text to be judged. For example, in the legal field, the first text may be a case description, such as a party's statement, a court judgment, an indictment, etc. For example, in the medical field, the first text may be a description of a condition.
[0144] The second text may be the content of the judgment on the first text. For example, the second text may include legal factors to be extracted (also referred to as entities in the embodiment of the present application), and optionally, the second text may be a text fragment of a certain legal article (or other legal provisions). For another example, the second text may include medical factors to be extracted, and optionally, the second text may be a basis for diagnosis.
[0145] 502. Determine a first prompt and a second prompt based on entities included in the second text, wherein the first prompt indicates identifying a description of each entity in the first text; and the second prompt indicates determining the second text indication of the first text based on the description of each entity.
[0146] The second text may include at least one entity, which may be the legal factors or medical factors to be extracted as described above. An entity may be a noun object or concept in a vertical domain. An entity may have different descriptions in different scenarios.
[0147] For example, the second text is: The income percentage from foreign entity of the agent is normally less than 50%, and the first text is: "As could be seen from the facts on record as well as observations made by learned Commissioner(Appeals),during the year under consideration,Samsara Shipping Pvt.Ltd.,has provided services to six shipping companies including the assessee and out of the total commission earned of`3,83,20,806,it received an amount of`46,53,998,from the assessee which constitutes a meagre 12.14% of the total income earned by Samsara Shipping Pvt.Ltd.from various principals."
[0148] Entities in the second text may include the agent and income percentage. To accurately determine whether the first text meets the criteria indicated in the second text, descriptions of the entities may be extracted from the first text. For example, descriptions related to the agent and income percentage may be extracted from the first text.
[0149] For entities in a text that includes judgment content, the entity may be a concrete element (for example, whether the duration of a certain behavior exceeds a certain period) or an abstract element (for example, whether a certain entity operates independently). When the entity is an abstract element, it is often impossible to accurately express the judgment content indicated by the second text. Therefore, after obtaining the second text, it is possible to determine whether the entity in the second text is an abstract element (the judgment step can be performed through a language model). If the second text contains an abstract element, the information that needs to be explained about the abstract element can be output.
[0150] Specifically, in a possible implementation, a text input by a user (for example, a third text) can be obtained, and the third text is the judgment content of the first text; based on the third text, through a language model, it can be determined that the third text includes abstract entities; based on the third text and the received user input's interpretation of the abstract object, the second text is obtained.
[0151] Here's a specific example:
[0152] In a possible implementation, the first text obtained is: "As could be seen from the facts on record as well as observations made by learned Commissioner (Appeals), during the year under consideration, Samsara Shipping Pvt. Ltd., has provided services to six shipping companies including the assessee and out of the total commission earned of `3,83,20,806, it received an amount of `46,53,998, from the assessee which constitutes a meagre 12.14% of the total income earned by Samsara Shipping Pvt. Ltd. from various principals.". The third text obtained is: The income percentage from the foreign entity of the agent is immaterial.
[0153] The language model determines that the third text contains an abstract element and prompts the user to enter an explanation for the abstract element, thereby obtaining the second text: The income percentage from foreign entity of the agent is normally less than 50%.
[0154] Here's another specific example:
[0155] In one possible implementation, the first text obtained is: "Hence, the functions attributed on the basis of these emails are not at all enlarging the scope of actual functions performed by the AE than as per the agreement and the transfer pricing report. We have already found that functions performed by Adobe India are actually not different than the agreement and transfer pricing documentation." The third text obtained is: "The risk and function assumed by the local subsidiary is within the scope as disclosed." The language model determines that there are no abstract factors in the third text, and the third text can be directly used as the second text.
[0156] After identifying the entities included in the second text, a prompt may be constructed to guide the language model to determine the content indicated by the second text on the first text.
[0157] Specifically, the first prompt and the second prompt can be determined based on the entities included in the second text, wherein the first prompt indicates the identification of the description of each entity in the first text; and the second prompt indicates the determination of the second text indication for the first text based on the description of each entity.
[0158] The first prompt mentioned above can be understood as a process of entity connection, that is, extracting and connecting the concepts in the second text with the specific entities mentioned in the first text, and then generating a complete prompt (that is, the second prompt).
[0159] In a possible implementation, a description of each entity can be obtained based on the first text and the first prompt through a language model, and the second prompt can be constructed using the description of each entity.
[0160] It should be understood that the different named prompts described in the embodiments of this application can belong to the same prompt or different prompts, and this is not limited here. For example, the first prompt and the second prompt can be the same prompt input into the language model, or they can be different prompts input into the language model sequentially or simultaneously.
[0161] In an embodiment of the present application, a first prompt is used to guide a language model to identify the interpretation of an entity in a first text, and a language model is used to automatically decompose the task of understanding the elements into multiple NLP tasks, that is, the prompts are automatically decomposed and converted into standard NLP tasks for input.
[0162] For example, the first prompt may be:
[0163] ["{seg}Which agent's revenue is described in this passage?"→"{the agent}"],
[0164] ["{seg}What is the income percentage of{the agent}from foreign entity?"→"{income percentage}"],
[0165] For example, the second prompt may be:
[0166] ["Premise:The income percentage from foreign entity of{the agent}is{income percentage}.Hypothesis:The income percentage from foreign entity of{the agent}is normally less than50%"];
[0167] For example, the first prompt may be:
[0168] ["{seg}What is the local subsidiary referred to in the above?"→"{the local subsidiary}"],
[0169] ["{seg}Which file record Functions,Assets and Risk of{the local subsidiary}referred to in the above?"→"{file}"];
[0170] For example, the second prompt may be:
[0171] ["Premise:{seg}Hypothesis:The risk and function assumed by{the local subsidiary}is within the scope as{file}"].
[0172] Among them, based on the existing question "The risk and function assumed by the local subsidiary is within the scope as disclosed", the sub-questions are split: the specific reference of the local subsidiary in the original text refers to the specific document describing the risk and function; by designing the prompt "{seg}What is the local subsidiary referred to in the above?", the specific reference of the local subsidiary in the original text, "{the local subsidiary}", is obtained, which is the entity connection link.
[0173] Based on the specific reference "{the local subsidiary}" obtained, the prompt "{seg}Which file record Functions, Assets and Risk of {the local subsidiary} referred to in the above?" is designed to further obtain the specific file information "{file}" describing the risk and function;
[0174] Combined with the specific references "{the local subsidiary}" and "{file}" that have been obtained, the final factor extraction result is obtained by designing the prompt "Premise:{seg}Hypothesis:The risk and function assumed by{the local subsidiary}is within the scope as{file}".
[0175] 503. Obtain a determination result of the first text using a language model based on the first text, the first prompt, and the second prompt.
[0176] Taking the legal field as an example, the language model can be used to call professional APIs such as statutory limitation comparison, interest rate calculation, and entity verification to determine the first text.
[0177] Exemplarily, the determination result of the first text may be:
[0178] "{the agent}":Samsara Shipping Pvt.Ltd.
[0179] "{income percentage}":12.14%;
[0180] "Premise: The income percentage from foreign entity of {the agent} is {income percentage}. Hypothesis: The income percentage from foreign entity of {the agent} is normally less than 50%": yes.
[0181] Exemplarily, the determination result of the first text may be:
[0182] "{the local subsidiary}":Adobe India;
[0183] "{file}":the agreement and transfer pricing documentation;
[0184] "Premise:{seg}Hypothesis:The risk and function assumed by{the local subsidiary}is within the scope as{file}":yes.
[0185] For example, refer to FIG6 , which is a schematic diagram of a specific process of an embodiment of the present application, taking the legal field as an example.
[0186] Refer to Table 1, which shows a comparison between using the prompt manager splitting task through an embodiment of the present application and directly using ChatGPT for NLI judgment. As shown in Table 1, the embodiment of the present application significantly improves F1 at sentence granularity.
[0187] Table 1
[0188] Next, a data processing device provided by an embodiment of the present application will be described from the perspective of a device. Referring to FIG. 7 , FIG. 7 is a schematic diagram of the structure of a data processing device provided by an embodiment of the present application. As shown in FIG. 7 , a data processing device 700 provided by an embodiment of the present application includes:
[0189] The acquisition module 701 is used to acquire a first text and a second text; the first text is the text to be judged; the second text is the judgment content of the first text;
[0190] For a detailed introduction to the acquisition module 701 , reference may be made to the description of step 501 in the above embodiment, which will not be repeated here.
[0191] Processing module 702 is used to determine a first prompt and a second prompt based on entities included in the second text, wherein the first prompt indicates the description of identifying each entity in the first text; the second prompt indicates the determination of the second text indication for the first text based on the description of each entity; and the determination result of the first text is obtained through a language model based on the first text, the first prompt and the second prompt.
[0192] The detailed introduction of the processing module 702 can refer to the description of step 502 to step 503 in the above embodiment, which will not be repeated here.
[0193] In a possible implementation, the processing module is specifically configured to:
[0194] According to the entities included in the second text, a first prompt and a second prompt are determined through a language model.
[0195] In a possible implementation, the acquisition module is further configured to:
[0196] Acquire a third text, where the third text is a judgment content of the first text;
[0197] The processing module is further configured to determine, based on the third text and using a language model, that the third text includes an abstract entity; and obtain the second text based on the third text and an interpretation of the abstract object received from the user input.
[0198] In a possible implementation, the processing module is further configured to obtain a description of each entity based on the first text and the first prompt through a language model, and construct the second prompt based on the description of each entity.
[0199] In a possible implementation, the first text includes a case description; the second text includes legal elements; or, the first text includes a condition description; the second text includes medical elements.
[0200] Next, a terminal device provided in an embodiment of the present application is introduced. Please refer to Figure 8. Figure 8 is a structural schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 800 can be specifically manifested as a mobile phone, a tablet, a laptop computer, a smart wearable device, etc., which is not limited here. Among them, the terminal device 800 implements the function of the data processing method in the embodiment corresponding to Figure 5. Specifically, the terminal device 800 includes: a receiver 801, a transmitter 802, a processor 803 and a memory 804 (wherein the number of processors 803 in the terminal device 800 can be one or more), wherein the processor 803 may include an application processor 8031 and a communication processor 8032. In some embodiments of the present application, the receiver 801, the transmitter 802, the processor 803 and the memory 804 may be connected via a bus or other means.
[0201] The memory 804 may include a read-only memory and a random access memory, and provides instructions and data to the processor 803. A portion of the memory 804 may also include non-volatile random access memory (NVRAM). The memory 804 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.
[0202] Processor 803 controls the operation of the terminal device. In specific applications, the various components of the terminal device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all bus systems are referred to as a bus system in the figure.
[0203] The method disclosed in the above embodiment of the present application can be applied to the processor 803 or implemented by the processor 803. The processor 803 can be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 803. The above processor 803 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, and a vision processor (VPU), a tensor processing unit (TPU) and other processors suitable for AI computing. It can also further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 803 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory 804. The processor 803 reads the information in the memory 804 and, in conjunction with its hardware, completes steps 501 to 503 in the above embodiment.
[0204] Receiver 801 can be used to receive input digital or character information and generate signal input related to the relevant settings and function control of the terminal device. Transmitter 802 can be used to output digital or character information through the first interface. Transmitter 802 can also be used to send instructions to the disk pack through the first interface to modify the data in the disk pack. Transmitter 802 can also include a display device such as a display screen.
[0205] The embodiment of the present application also provides a server. Please refer to Figure 9, which is a schematic diagram of the structure of the server provided by the embodiment of the present application. Specifically, the server 900 is implemented by one or more servers. The server 900 may have relatively large differences due to different configurations or performance. It may include one or more central processing units (CPU) 99 (for example, one or more processors) and memory 932, and one or more storage media 930 (for example, one or more mass storage devices) for storing application programs 942 or data 944. Among them, the memory 932 and the storage medium 930 can be temporary storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 99 can be configured to communicate with the storage medium 930 to execute a series of instruction operations in the storage medium 930 on the server 900.
[0206] The server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958; or, one or more operating systems 941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0207] Specifically, the server may perform steps 501 to 503 in the above embodiment.
[0208] An embodiment of the present application also provides a computer program product, which, when running on a computer, enables the computer to execute the steps executed by the aforementioned execution device, or enables the computer to execute the steps executed by the aforementioned training device.
[0209] A computer-readable storage medium is also provided in an embodiment of the present application, which stores a program for signal processing. When the computer-readable storage medium is run on a computer, it enables the computer to execute the steps executed by the aforementioned execution device, or enables the computer to execute the steps executed by the aforementioned training device.
[0210] The execution device, training device or terminal device provided in the embodiments of the present application can specifically be a chip, and the chip includes: a processing unit and a communication unit, the processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin or a circuit, etc. The processing unit can execute the computer execution instructions stored in the storage unit, so that the chip in the execution device executes the data processing method described in the above embodiment, or so that the chip in the training device executes the data processing method described in the above embodiment. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc. The storage unit can also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0211] Specifically, see Figure 10, which is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip can be represented as a neural network processor NPU 1000. NPU 1000 is mounted on the host CPU (host CPU) as a coprocessor and is assigned tasks by the host CPU. The core of the NPU is arithmetic circuit 1003, which is controlled by controller 1004 to extract matrix data from memory and perform multiplication operations.
[0212] The NPU 1000 can implement the data processing method provided in the embodiment described in FIG. 5 through the mutual cooperation between various internal components.
[0213] More specifically, in some implementations, the arithmetic circuit 1003 in the NPU 1000 includes multiple processing units (PEs). In some implementations, the arithmetic circuit 1003 is a two-dimensional systolic array. The arithmetic circuit 1003 can also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1003 is a general-purpose matrix processor.
[0214] For example, assume there are input matrix A, weight matrix B, and output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from weight memory 1002 and caches it on each PE in the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from input memory 1001 and performs a matrix operation on matrix B. The partial or final matrix result is stored in accumulator 1008.
[0215] The unified memory 1006 is used to store input data and output data. Weight data is directly transferred to the weight memory 1002 through the Direct Memory Access Controller (DMAC) 1005. The input data is also transferred to the unified memory 1006 through the DMAC.
[0216] BIU stands for Bus Interface Unit, i.e., bus interface unit 1010 , which is used for interaction between the AXI bus, DMAC, and instruction fetch buffer (IFB) 1009 .
[0217] The bus interface unit 1010 (BIU) is used for the instruction fetch memory 1009 to obtain instructions from the external memory, and is also used for the storage unit access controller 1005 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0218] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1006 or transfer weight data to the weight memory 1002 or transfer input data to the input memory 1001.
[0219] The vector calculation unit 1007 includes multiple operation processing units. When necessary, it further processes the output of the operation circuit 1003, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / fully connected layer network calculations in neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.
[0220] In some implementations, the vector calculation unit 1007 can store the processed output vector in the unified memory 1006. For example, the vector calculation unit 1007 can apply a linear function or a nonlinear function to the output of the operation circuit 1003, such as linear interpolation of the feature plane extracted by the convolution layer, or accumulate a vector of values to generate an activation value. In some implementations, the vector calculation unit 1007 generates a normalized value, a pixel-level summed value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 1003, for example, for use in subsequent layers in a neural network.
[0221] An instruction fetch buffer 1009 connected to the controller 1004 is used to store instructions used by the controller 1004;
[0222] Unified memory 1006, input memory 1001, weight memory 1002, and instruction fetch memory 1009 are all on-chip memories. External memories are private to the NPU hardware architecture.
[0223] The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the above program.
[0224] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0225] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.
[0226] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0227] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
Claims
1. A data processing method, characterized in that: The method comprises: Acquire a first text and a second text; the first text is the text to be judged; the second text is the judgment content of the first text; Determine a first prompt and a second prompt according to entities included in the second text, wherein the first prompt indicates a description of identifying each entity in the first text; and the second prompt indicates a determination of the second text indication on the first text according to the description of each entity; A determination result of the first text is obtained through a language model according to the first text, the first prompt and the second prompt.
2. The method according to claim 1, characterized in that The determining, according to the entity included in the second text, the first prompt and the second prompt comprises: According to the entities included in the second text, the first prompt and the second prompt are determined by using a language model.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquire a third text, where the third text is a determination made on the first text; According to the third text, determining, by means of a language model, that the third text includes an abstract entity; The second text is obtained according to the third text and the received user input interpretation for the abstract object.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: According to the first text and the first prompt, a description of each entity is obtained through a language model, and the second prompt is constructed according to the description of each entity.
5. The method according to any one of claims 1 to 4, characterized in that: The first text includes a case description; the second text includes legal elements; or, the first text includes a condition description; the second text includes medical elements.
6. A data processing device, characterized in that: The device comprises: An acquisition module is used to acquire a first text and a second text; the first text is the text to be judged; the second text is the judgment content of the first text; A processing module is used to determine a first prompt and a second prompt based on entities included in the second text, wherein the first prompt indicates the description of identifying each entity in the first text; the second prompt indicates the determination of the second text indication for the first text based on the description of each entity; and the determination result of the first text is obtained through a language model based on the first text, the first prompt and the second prompt.
7. The device according to claim 6, characterized in that The processing module is specifically used for: According to the entities included in the second text, the first prompt and the second prompt are determined by using a language model.
8. The device according to claim 6 or 7, characterized in that The acquisition module is further used for: Acquire a third text, where the third text is a determination made on the first text; The processing module is further used to determine, based on the third text and through a language model, that the third text includes an abstract entity; and obtain the second text based on the third text and an interpretation of the abstract object received from the user input.
9. The device according to any one of claims 6 to 8, characterized in that: The processing module is further used to obtain a description of each entity according to the first text and the first prompt through a language model, and to construct the second prompt according to the description of each entity.
10. The device according to any one of claims 6 to 9, characterized in that: The first text includes a case description; the second text includes legal elements; or, the first text includes a condition description; the second text includes medical elements.
11. A computing device, characterized in that: The computing device includes a memory and a processor; the memory stores codes, and the processor is configured to obtain the codes and execute the method according to any one of claims 1 to 5.
12. A computer storage medium, characterized in that: The computer storage medium stores one or more instructions, which, when executed by one or more computers, enable the one or more computers to implement the method of any one of claims 1 to 5.
13. A computer program product comprising code, characterized in that When the code is executed, it is used to implement the method according to any one of claims 1 to 5.
14. A chip, comprising a processor, characterized in that: The processor is used to support a data processing device to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method and related device
CN117151099A
Named entity identification method and device, equipment and storage medium
CN114239578A
Medical entity relationship identification method and device, electronic equipment and storage medium
CN114913953A
Training method of information extraction model, and information extraction method and device
CN116303872A
Large language model knowledge enhancement method and system, electronic equipment and medium
CN116303980A
Cited By
Post-training method and device of question and answer large model, electronic equipment and storage medium
CN119808964A