CN114547257A - Class matching method and device, computer equipment and storage medium - Google Patents

Class matching method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114547257A
CN114547257A CN202210437396.0A CN202210437396A CN114547257A CN 114547257 A CN114547257 A CN 114547257A CN 202210437396 A CN202210437396 A CN 202210437396A CN 114547257 A CN114547257 A CN 114547257A
Authority
CN
China
Prior art keywords
event
case
target
extraction
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210437396.0A
Other languages
Chinese (zh)
Other versions
CN114547257B (en
Inventor
陈晓红
文泽雄
胡东滨
曹文治
徐雪松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University of Technology
Original Assignee
Hunan University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan University of Technology filed Critical Hunan University of Technology
Priority to CN202210437396.0A priority Critical patent/CN114547257B/en
Publication of CN114547257A publication Critical patent/CN114547257A/en
Application granted granted Critical
Publication of CN114547257B publication Critical patent/CN114547257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/18Legal services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Tourism & Hospitality (AREA)
  • Evolutionary Biology (AREA)
  • Economics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Technology Law (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a class case matching method, which is applied to the technical field of judicial cases and used for improving the accuracy of class case matching. The method provided by the application comprises the following steps: acquiring a target case, and performing element extraction on the target case according to a preset event extraction rule to obtain event characteristic information; acquiring case samples through an online database, forming a case sample library, and performing factor extraction and cause-and-effect relationship extraction on the case samples to obtain an event connection diagram of the case samples; according to the preset event extraction rule, performing element marking on the named entity in the event connection graph, acquiring event element information and generating event element nodes to form a case map; calculating the vector similarity of the event characteristic information and the case map to obtain a matching value of the event characteristic information and the case map; and screening similar cases of the target case from the case sample library based on the matching value.

Description

Class matching method and device, computer equipment and storage medium
Technical Field
The present application relates to the technical field of judicial cases, and in particular, to a case matching method, an apparatus, a computer device, and a storage medium.
Background
At present, with the increasing legal consciousness and the increasing right consciousness of people, the number of judicial cases is also increasing. When dealing with a case, people tend to search for similar cases and make reference to the cases so as to further understand the case points and related laws related to the cases.
The existing retrieval method generally queries similar cases according to a retrieval engine, mainly performs matching based on sentence levels, converts word senses, semantics and syntactic structures of sentences into vectors, and then classifies time trigger words and event elements by using a classifier. However, case documents of similar cases often contain much information, and key information is lost only by converting sentence-level events into chapter-level events, so that the retrieval accuracy of the similar cases is not high.
Disclosure of Invention
The application provides a method and a device for matching a class case, computer equipment and a storage medium, so as to improve the accuracy of class case matching.
A pattern matching method, comprising:
acquiring a target case, and performing element extraction on the target case according to a preset event extraction rule to obtain event feature information, wherein the event feature information comprises at least one target element and corresponding target element information, the preset event extraction rule comprises an extraction rule of a named entity, and the named entity type comprises an event type, an event trigger word, an event element and an element role;
acquiring case samples through an online database, forming a case sample library, and performing element extraction and cause-and-effect relationship extraction on the case samples to obtain an event connection diagram of the case samples;
according to the preset event extraction rule, performing element marking on the named entity in the event connection graph, acquiring event element information and generating event element nodes to form a case map;
calculating the vector similarity of the event characteristic information and the case map to obtain a matching value of the event characteristic information and the case map;
and screening similar cases of the target case from the case sample library based on the matching value.
A class matching device comprising:
the system comprises a characteristic information acquisition module, a characteristic information acquisition module and a characteristic information acquisition module, wherein the characteristic information acquisition module is used for acquiring a target case and performing element extraction on the target case according to a preset event extraction rule to obtain event characteristic information, the event characteristic information comprises at least one target element and corresponding target element information, the preset event extraction rule comprises an extraction rule of a named entity, and the type of the named entity comprises an event type, an event trigger word, an event element and an element role;
the system comprises a connection diagram generation module, a case analysis module and a case analysis module, wherein the connection diagram generation module is used for acquiring case samples through an online database, forming a case sample library, and performing element extraction and cause-effect relationship extraction on the case samples to obtain event connection diagrams of the case samples;
the case map generation module is used for performing element marking on the named entities in the event connection graph according to the preset event extraction rule, acquiring event element information and generating event element nodes to form a case map;
the matching value calculation module is used for calculating the vector similarity of the event characteristic information and the case map to obtain a matching value of the event characteristic information and the case map;
and the case matching module is used for screening similar cases of the target case from the case sample library based on the matching value.
A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor implementing the steps of the above-described pattern matching method when executing the computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned class matching method.
According to the case matching method, the case sample is obtained by extracting the event characteristic information in the target case, the case map is generated according to the case sample, the key information is extracted according to the named entity extraction mode to form the case map, the similarity between the target case and the case sample is obtained by comparing the similarity between the element information in the time characteristic information and the element information of the case map, and the similar case similar to the target case is accurately matched.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a diagram of an application environment of a class matching method according to an embodiment of the present application;
FIG. 2 is a flow chart of a class matching method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a class matching apparatus according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The class matching method provided by the embodiment of the application can be applied to the application environment shown in fig. 1, wherein the computer device communicates with the server through a network. The computer device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
The system framework 100 may include terminal devices, networks, and servers. The network serves as a medium for providing a communication link between the terminal device and the server. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use a terminal device to interact with a server over network 104 to receive or send messages, etc.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, motion Picture experts compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, motion Picture experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the class matching method provided in the embodiment of the present application is executed by a server, and accordingly, the class matching apparatus is disposed in the server.
It should be understood that the number of the terminal devices, the networks, and the servers in fig. 1 is only illustrative, and any number of the terminal devices, the networks, and the servers may be provided according to implementation requirements, and the terminal devices in the embodiment of the present application may specifically correspond to an application system in actual production.
In an embodiment, as shown in fig. 2, a method for matching a pattern is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps S10 to S50.
S10, acquiring a target case, and performing element extraction on the target case according to a preset event extraction rule to obtain event feature information, wherein the event feature information comprises at least one target element and corresponding target element information, the preset event extraction rule comprises an extraction rule of a named entity, and the named entity type comprises an event type, an event trigger word, an event element and an element role.
Specifically, the target case refers to a judicial case for performing a category query, and may be a case currently being processed. A class refers to judicial cases similar to the target case, and similar to the target case refers to cases of similar type, similar causes, and the like. By inquiring similar cases, legal information and judicial documents of the corresponding cases are known.
The preset event extraction rule defines a named entity type in a case and a corresponding named entity extraction rule, wherein the named entity type comprises an event type, an event trigger word, an event element and an element role.
The event type refers to the scheme setting mode of a judicial case, such as self-beginning, case reporting and the like; the event trigger words refer to words such as 'self-beginning', 'initiative case-putting', and the like; element roles refer to related persons of a case, such as time, record units, defendees, units, and the like; the event element refers to element information corresponding to an element role, for example, a specific time corresponding to a time element role and a unit name corresponding to a solution unit.
The event characteristic information refers to case information corresponding to a target case, and corresponding named entities and characteristic information corresponding to the named entities are extracted from the target case according to a preset event extraction rule to form event characteristic information.
Specifically, event feature information of the target case is obtained according to a preset event extraction rule, and the event feature information includes an event type, an event trigger word, an event element, an element role and the like of the target case.
And S20, acquiring case samples through the online database, forming a case sample library, and performing element extraction and cause and effect relation extraction on the case samples to obtain an event connection diagram of the case samples.
Specifically, the online database refers to a database containing judicial cases, and specifically may be a referee document network, and the case samples on the referee document network are obtained to form a case sample database. In the process of obtaining the case sample library, case samples of the same case type can be obtained according to the case type of the target case, so that the efficiency of constructing the case sample library is improved. For example, if the target case is an eco-friendly case, a case sample of the eco-friendly case is obtained.
As an optional implementation mode, after the case sample library is constructed, case documents in the case sample library are cleaned, stop words and missing information are removed, and then element extraction and causal relationship extraction are carried out on the case samples.
The element extraction refers to extracting element information of the case sample according to a preset event extraction rule, meanwhile, performing causal relationship analysis and extraction on documents in the case sample to obtain a causal relationship, and constructing an event connection diagram of the case sample according to the element information and the causal relationship.
Causal relationships are used to characterize associations between named entities in case samples, and there are four specific cases:
(1) a causal relationship, i.e. event a, results in event B, for example: ' the damage of the ecological environment of the drainage basin is caused by the illegal fishing of Wangzhi, etc.;
(2) a sequential relationship, i.e. event a and event B have a sequential logical relationship, for example: "Wangzhi cuts the tree and then pulls it. ";
(3) the parallel relation is that the event A and the event B occur together;
(4) the turning relationship, event a is opposite to event B.
It should be noted that the case sample library includes a plurality of case samples, and the step S20 is performed for each case sample to obtain an event connection map of each case sample.
And S30, according to a preset event extraction rule, performing element labeling on the named entity in the event connection graph, acquiring event element information and generating event element nodes to form a case graph.
Specifically, after the element extraction in S20, according to a preset event extraction rule, element labeling is performed on the named entity in the event connection graph to obtain event element information, and according to the type of the named entity and the corresponding event element information, a case map is formed.
And S40, calculating the vector similarity of the event characteristic information and the case map to obtain a matching value of the event characteristic information and the case map.
Specifically, calculating the vector similarity between the target element information of the event feature information and the event element information of the case map specifically includes: calculating a target feature vector of target element information of the event feature information and an element vector of the event element information, calculating the vector similarity of the target feature vector and the event element vector in a cosine similarity mode, obtaining a similarity result, and obtaining a matching value of the event feature information and the case map, namely taking the matching value as the matching degree of the target case and the case sample corresponding to the case map.
And S50, screening similar cases of the target case from the case sample library based on the matching value.
Specifically, based on the matching value, the case sample with the largest matching value is taken as the similar case of the target case.
It should be noted that, the case samples of the preset number are screened out from the big to the small matching values as similar cases of the target case according to the sorting of the matching values.
According to the case matching method, a case sample library is formed by obtaining case samples, element extraction and cause and effect extraction are conducted on the case sample library to obtain an event connection graph of the case samples, named entity extraction is conducted according to the event connection graph to obtain event element information of the case samples, and event element nodes are generated to form a case graph. According to a preset event extraction rule, event feature information of a target case is generated, vector similarity calculation is carried out on the event feature information and a case map to obtain a matching value of the target case and a case sample, similar cases of the target case are obtained according to the matching value, and accuracy of matching the target case to the similar cases is improved according to a factor matching mode.
As an alternative implementation manner, in step S10, acquiring a target case, and performing element extraction on the target case according to a preset event extraction rule to obtain event feature information includes the following steps S101 to S102.
S101, acquiring a case text of a target case, and determining a target element of the case text according to a preset event extraction rule.
And S102, extracting elements of the target elements, and taking the target element information obtained by extraction as event characteristic information.
Specifically, a case text of a target case is obtained, and target elements in the case text are extracted according to a preset event extraction rule, wherein the target elements refer to named entities, namely event types, event trigger words, event elements, element roles and the like.
And extracting target element information corresponding to the target elements in the case text as event characteristic information.
In the embodiment, the named entity of the target case is extracted, the feature information of the target case is identified through the named entity and extracted through the elements to generate the event feature information of the target case, and similar cases are matched for the target case only through the event feature information, so that the case text of the target case is prevented from being analyzed, the matching efficiency of the cases is improved, meanwhile, information extraction through sentence semantics is avoided, and loss of key information is reduced.
As an alternative implementation manner, in step S20, obtaining case samples through an online database, and constructing a case sample library, and performing element extraction and causal relationship extraction on the case samples to obtain an event connection graph of the case samples includes the following steps S201 to S204.
S201, obtaining the judgment text of the case sample through the online database to form a case sample library.
S202, after preprocessing the judgment text, performing dependency grammar analysis on the judgment text to obtain an analysis result.
And S203, performing element extraction and cause-and-effect extraction on the judgment text based on the analysis result to obtain event elements and cause-and-effect relations among the event elements.
And S204, forming an event triple based on the event elements and the causal relationship, and forming an event connection diagram based on the event triple.
Specifically, a case sample judgment text is obtained through an online database, and a case sample library is formed by taking a case sample as a unit.
And performing text processing on the judgment text, wherein the text processing mode comprises text cleaning, stop word removal, Chinese word segmentation and part of speech tagging to obtain the preprocessed judgment text.
And performing dependency grammar analysis on the preprocessed judgment text to identify the dependency relationship of each sentence in the judgment text on a logic level, wherein the core is to extract a core verb in the sentence as a central component to obtain a syntactic mechanism of the sentence and subject and predicate distribution information in the sentence in the judgment text so as to further analyze the syntactic structure and the semantic meaning of the sentence in the following.
And obtaining an analysis result after performing dependency grammar analysis. And identifying element information corresponding to each sentence and causal relationship among the sentences according to the syntactic structures of the sentences shown in the analysis result, performing causal extraction on the causal relationship, forming event triples by the identified event elements and the causal relationship, using the event elements as nodes of an event connection graph, and using the relationship among the event elements as edges of the event connection graph.
The event triplets are represented as: event element-cause-effect-event element. The event element is a sentence with a major-minor grammar structure and represents the process of event occurrence, namely, someone does something.
In the embodiment, element extraction and cause-and-effect relationship are carried out on case samples, the extracted key information forms an event connection diagram to form cause-and-effect relationship among event elements, dependency grammar analysis is carried out on case castration versions, and when element extraction and cause-and-effect extraction are carried out subsequently, the syntactic structure and semantic meaning of sentences can be further understood, and the accuracy of accurately extracting the event elements is further ensured.
As an alternative embodiment, in step S204, an event triple is constructed based on the event element and the causal relationship, and constructing the event connection graph based on the event triple includes steps S241 to S242.
And S241, taking the event elements of the event triple as nodes, and iteratively calculating the weights of the nodes through a textrank algorithm until the weights are converged to obtain the node weights.
And S242, sequencing the nodes according to the node weight sequence, generating a sequence list, and selecting a preset number of nodes in the front row of the sequence list to form an event connection graph.
Specifically, event elements in the event triple are used as nodes, and a relationship between the event elements is used as an edge to connect two event elements with a causal relationship, so as to form a connection relationship.
Calculating and adjusting the node weight of the node through an iterative formula in a Textrank algorithm until the node weight is converged; and sequencing according to the node weight, selecting a preset number of nodes, and reserving the connection relation among the nodes to form an event connection graph.
Wherein, the iterative formula of the Textrank algorithm is represented as:
Figure 966030DEST_PATH_IMAGE001
Figure 617592DEST_PATH_IMAGE002
a node weight representing the event element i,
Figure 318700DEST_PATH_IMAGE003
the node weight representing the event element j,
Figure 448330DEST_PATH_IMAGE004
representing the similarity between event element j and event element i,
Figure 793861DEST_PATH_IMAGE005
the similarity between the event element j and the event element k is represented, and the damping coefficient is represented by d, and the value is generally 0.85.
Figure 288427DEST_PATH_IMAGE006
Representing the set of nodes where the event element j is located,
Figure 289881DEST_PATH_IMAGE007
representing an event element k.
The similarity between the event elements is calculated by calculating the repetition of the words contained between the sentences corresponding to the two event elements, and the specific calculation mode is as follows:
Figure 285519DEST_PATH_IMAGE009
Figure 688819DEST_PATH_IMAGE010
represents the number of sentence words contained in the sentence in the event element i,
Figure 603554DEST_PATH_IMAGE011
representing the number of sentence words contained in the sentence in event element j,
Figure 92304DEST_PATH_IMAGE012
indicating the number of words that appear in both event element j and event element i.
In this embodiment, an event connection graph is constructed according to event triples, iterative computation is performed on node weights in the event connection graph according to a textrank algorithm, and then the similarity between nodes is updated to generate the event connection graph, so that the association of each node in the event connection graph is improved.
As an alternative implementation manner, in step S30, according to a preset event extraction rule, performing element labeling on a named entity in an event connection graph, acquiring event element information, and generating event element nodes to form a case graph includes steps S301 to S303.
S301, acquiring a text corresponding to each node in the event connection diagram as a text to be labeled.
S302, according to a preset event extraction rule, element labeling is carried out on the named entity of the text to be labeled, and corresponding event element information is obtained.
S303, taking the node with the named entity type as the event trigger word as a central node, taking other named entity types as peripheral nodes, and forming a case map by the central node and the peripheral nodes.
Specifically, a text corresponding to a node in the event connection graph is obtained and used as a text to be labeled, a named entity in the text to be labeled is labeled, and text information corresponding to the type of the named entity is obtained and used as event element information. Specifically, the named entity in the text to be labeled specifically includes an event type, an event trigger, an event element, and an element role.
The preset event extraction rule refers to an extraction rule of a named entity, and the specific description is explained above and is not described again.
The event element information refers to element information corresponding to each named entity type, for example, the event type refers to an application form of a case, and the like, and the event element information corresponding to the event type is an application, a self-beginning case, and the like.
And taking the node with the event trigger word as a central node, taking the nodes of other named entity types as peripheral nodes, and forming a case map by the central node and the peripheral nodes.
In this embodiment, the case map takes the named entity as a constituent node of the case map according to a preset event extraction rule, and represents the case information of the case sample in a map form, so that the key information of the case can be represented according to the map, and the event element information with more key information can be screened out according to a mode of iterating the node weight, thereby accelerating the efficiency of matching similar cases for the target case.
As an alternative implementation manner, in step S40, calculating the vector similarity between the event feature information and the case map, and obtaining the matching value between the event feature information and the case map includes steps S401 to S403.
S401, based on the same named entity type, calculating a target feature vector of the target element information, and calculating an event element vector of the event element information corresponding to the event element node.
S402, calculating cosine similarity of the target feature vector and all event element vectors of the same entity named entity type, and calculating a similarity mean value of target element information and all event element nodes based on the cosine similarity.
And S403, summing the similarity mean values of all named entity types to obtain a similarity sum value, and taking the similarity sum value as a matching value of the event feature information and the case map.
Specifically, according to the same named entity type, a target feature vector of the target element information is calculated, and an event element vector of the event element information corresponding to the event element node is calculated at the same time.
Calculating cosine similarity of a target feature vector and an event element vector of the same named entity type, calculating cosine similarity mean of the target feature vector and the event element vector of the same named entity type, and obtaining similarity mean, wherein the specific method comprises the following steps: respectively calculating cosine similarity of the target feature vector and all event element vectors; and summing all the cosine similarities, and then calculating the average value to obtain the similarity average value.
Respectively calculating the similarity mean value of each named entity type, summing the similarity mean values of all the named entity types to obtain a similarity sum value, and taking the similarity sum value as the matching degree of the event characteristic information and the case map, wherein the matching degree identifies the similarity degree of the target case and the case sample.
It should be noted that, in steps S401 to S403, a case sample is taken as an example, and the finally obtained matching value represents the matching degree between the case sample and the target sample. In fact, in the present embodiment, a plurality of case samples are included, and then the matching values of all case samples should be calculated.
In the embodiment, the matching value of the event characteristic information and the case map is obtained by calculating the vector similarity of the event characteristic information and the case map, and the matching value is used as an index of the case-like fart matching, so that the efficiency of case-like matching is further improved without comparing the full text of the target case with a case sample.
As an alternative embodiment, step S41 to S42 are further included in step S40.
S41, calculating the element weight of the event element nodes in the case graph through a textrank algorithm, and screening out the event element nodes with the maximum element weight in a preset number as case element nodes according to the element weight.
And S42, calculating case element vectors of case element nodes, calculating cosine similarity between the case element vectors and the target characteristic vectors, and obtaining a similarity mean value.
Specifically, as a preferred embodiment, before the matching value between the event feature information and the case graph is calculated, the element weight of the event element node in the case graph is calculated through a textrank algorithm until iteration is stopped, a preset number of event element nodes are screened out from each named entity type according to the size of the element weight to serve as the case element node, the similarity mean value between the case element node and the target feature vector is calculated, and the step S403 is executed to obtain the matching value between the case graph and the event feature information.
In this embodiment, the element weights in the case graph are calculated through the textrank algorithm, so that event element nodes with larger weights are selected less, and the matching values are subsequently calculated to match more similar case samples for the target case, so that the case matching effect is improved, and the accuracy of the matching result is ensured.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
In one embodiment, a pattern matching apparatus is provided, which is in one-to-one correspondence with the pattern matching method in the above embodiments. As shown in fig. 3, the pattern matching apparatus includes a feature information obtaining module 31, a connection diagram generating module 32, a case map generating module 33, a matching value calculating module 34, and a pattern matching module.
The feature information obtaining module 31 is configured to obtain a target case, and perform element extraction on the target case according to a preset event extraction rule to obtain event feature information, where the event feature information includes at least one target element and corresponding target element information, the preset event extraction rule includes an extraction rule of a named entity, and the named entity type includes an event type, an event trigger word, an event element, and an element role.
And the connection map generating module 32 is configured to obtain case samples through the online database, form a case sample library, and perform element extraction and cause-and-effect relationship extraction on the case samples to obtain event connection maps of the case samples.
The case map generating module 33 is configured to perform element labeling on the named entities in the event connection graph according to a preset event extraction rule, acquire event element information, and generate event element nodes to form a case map.
And the matching value calculating module 34 is configured to calculate a vector similarity between the event feature information and the case map, so as to obtain a matching value between the event feature information and the case map.
And the case matching module 35 is used for screening out similar cases of the target case from the case sample library based on the matching value.
As an alternative embodiment, the feature information acquisition module 31 includes the following units.
And the target element acquisition unit is used for acquiring the case text of the target case and determining the target elements of the case text according to a preset event extraction rule.
And the event characteristic information acquisition unit is used for extracting elements of the target elements and taking the extracted target element information as event characteristic information.
As an alternative embodiment, the connection map generation module 32 includes the following units.
And the sample acquisition unit is used for acquiring the judgment text of the case sample through the online database to form a case sample library.
And the text processing unit is used for carrying out dependency grammar analysis on the judgment text after preprocessing the judgment text to obtain an analysis result.
And the element extraction unit is used for performing element extraction and cause-and-effect extraction on the judgment text based on the analysis result to obtain the event elements and the cause-and-effect relationship among the event elements.
And the first connection diagram forming unit is used for forming event triples based on the event elements and the causal relationship, and forming an event connection diagram based on the event triples.
As an optional implementation manner, the connection diagram generation module further includes the following units.
And the node weight generating unit is used for taking the event elements of the event triples as nodes, and iteratively calculating the weights of the nodes through a textrank algorithm until the weights are converged to obtain the node weights.
And the second connection diagram forming module is used for sequencing the nodes according to the weight sequence of the nodes, generating a sequencing list, and selecting a preset number of nodes in the front row of the sequencing list to form the event connection diagram.
As an alternative embodiment, the case map generation module 33 includes the following units.
And the text to be labeled acquiring unit is used for acquiring a text corresponding to each node in the event connection diagram as the text to be labeled.
And the event element information acquisition unit is used for performing element marking on the named entity of the text to be marked according to a preset event extraction rule and acquiring corresponding event element information.
And the case map generating unit is used for taking the node of which the named entity type is the event trigger word as a central node, taking other named entity types as peripheral nodes, and forming a case map by the central node and the peripheral nodes.
As an alternative embodiment, the matching value calculation module 34 includes the following units.
And the vector generating unit is used for calculating a target characteristic vector of the target element information based on the same named entity type and calculating an event element vector of the event element information corresponding to the event element node.
And the similarity calculation unit is used for calculating cosine similarity of the target feature vector and all event element vectors of the same entity named entity type, and calculating a similarity mean value of the target element information and all event element nodes based on the cosine similarity.
And the matching value calculating unit is used for summing the similarity mean values of all the named entity types to obtain a similarity sum value, and taking the similarity sum value as a matching value of the event characteristic information and the case map.
As an optional implementation, the class matching apparatus further includes the following modules.
And the case element node module is used for calculating the element weight of the event element node in the case map through a textrank algorithm, and screening out the event element nodes with the maximum element weight in a preset number as the case element nodes according to the element weight.
And the similarity mean value calculating module is used for calculating case element vectors of case element nodes, calculating cosine similarity between the case element vectors and the target characteristic vectors and obtaining a similarity mean value.
The meaning of "first" and "second" in the above modules/units is only to distinguish different modules/units, and is not used to define which module/unit has higher priority or other defining meanings. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such process, method, article, or apparatus, and such that a division of modules presented in this application is merely a logical division and may be implemented in a practical application in a further manner.
For the specific definition of the pattern matching device, reference may be made to the above definition of the pattern matching method, which is not described herein again. The various modules in the above-described class matching apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data involved in the class matching method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a pattern matching method.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and running on the processor, the processor when executing the computer program implementing the steps of the pattern matching method in the above embodiments, such as the steps S10 to S50 shown in fig. 2 and other extensions of the method and related steps. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the class matching apparatus in the above-described embodiments, such as the functions of the modules 31 to 35 shown in fig. 3. To avoid repetition, further description is omitted here.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the computer device and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc.
The memory may be integrated in the processor or may be provided separately from the processor.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the pattern matching method in the above-described embodiments, such as the steps S10 through S50 shown in fig. 2 and extensions of other extensions and related steps of the method. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the class matching apparatus in the above-described embodiments, such as the functions of the modules 31 to 35 shown in fig. 3. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art. The technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A pattern matching method, comprising:
acquiring a target case, and performing element extraction on the target case according to a preset event extraction rule to obtain event feature information, wherein the event feature information comprises at least one target element and corresponding target element information, the preset event extraction rule comprises an extraction rule of a named entity, and the named entity type comprises an event type, an event trigger word, an event element and an element role;
acquiring case samples through an online database, forming a case sample library, and performing factor extraction and cause-and-effect relationship extraction on the case samples to obtain an event connection diagram of the case samples;
according to the preset event extraction rule, performing element marking on the named entity in the event connection graph, acquiring event element information and generating event element nodes to form a case map;
calculating the vector similarity of the event characteristic information and the case map to obtain a matching value of the event characteristic information and the case map;
and screening similar cases of the target case from the case sample library based on the matching value.
2. The case matching method according to claim 1, wherein the obtaining of the target case and the element extraction of the target case according to a preset event extraction rule comprise:
acquiring a case text of the target case, and determining a target element of the case text according to a preset event extraction rule;
and extracting elements of the target elements, and taking the extracted target element information as event characteristic information.
3. The case matching method according to claim 1, wherein the obtaining of case samples and the formation of a case sample library through an online database, and the performing of element extraction and causal relationship extraction on the case samples to obtain the event connection graph of the case samples comprises:
acquiring a judgment text of a case sample through an online database to form a case sample library;
after preprocessing the judgment text, performing dependency grammar analysis on the judgment text to obtain an analysis result;
performing element extraction and cause-and-effect extraction on the judgment text based on the analysis result to obtain event elements and cause-and-effect relations among the event elements;
and constructing an event triple based on the event elements and the causal relationship, and constructing an event connection graph based on the event triple.
4. The method according to claim 3, wherein the constructing an event triple based on the event element and the causal relationship comprises:
taking the event elements of the event triple as nodes, and iteratively calculating the weights of the nodes through a textrank algorithm until the weights are converged to obtain the node weights;
and sequencing the nodes according to the weight sequence of the nodes to generate a sequencing list, and selecting a preset number of nodes in the front row of the sequencing list to form the event connection graph.
5. The case matching method according to claim 1, wherein the labeling elements of the named entities in the event connection graph according to the preset event extraction rule, acquiring event element information, and generating event element nodes to form a case graph comprises:
acquiring a text corresponding to each node in the event connection graph as a text to be labeled;
according to the preset event extraction rule, performing element marking on the named entity of the text to be marked, and acquiring corresponding event element information;
and taking the node with the named entity type as an event trigger word as a central node, taking other named entity types as peripheral nodes, and forming a case map by the central node and the peripheral nodes.
6. The case matching method according to claim 1, wherein the calculating of the vector similarity between the event feature information and the case map to obtain the matching value between the event feature information and the case map comprises:
calculating a target characteristic vector of the target element information based on the same named entity type, and calculating an event element vector of event element information corresponding to the event element node;
calculating cosine similarity of the target feature vector and all event element vectors of the same entity named entity type, and calculating a similarity mean value of target element information and all event element nodes based on the cosine similarity;
and summing the similarity mean values of all named entity types to obtain a similarity sum value, and taking the similarity sum value as a matching value of the event characteristic information and the case map.
7. The pattern matching method of claim 6, further comprising:
calculating the element weight of event element nodes in the case graph through a textrank algorithm, and screening out a preset number of event element nodes with the maximum element weight as case element nodes according to the size of the element weight;
and calculating case element vectors of the case element nodes, calculating cosine similarity between the case element vectors and the feature vectors, and obtaining a similarity mean value.
8. A pattern matching apparatus, comprising:
the system comprises a characteristic information acquisition module, a characteristic information acquisition module and a characteristic information acquisition module, wherein the characteristic information acquisition module is used for acquiring a target case and performing element extraction on the target case according to a preset event extraction rule to obtain event characteristic information, the event characteristic information comprises at least one target element and corresponding target element information, the preset event extraction rule comprises an extraction rule of a named entity, and the type of the named entity comprises an event type, an event trigger word, an event element and an element role;
the system comprises a connection diagram generation module, a case analysis module and a case analysis module, wherein the connection diagram generation module is used for acquiring case samples through an online database, forming a case sample library, and performing element extraction and cause-and-effect relationship extraction on the case samples to obtain event connection diagrams of the case samples;
the case map generation module is used for performing element marking on the named entities in the event connection graph according to the preset event extraction rule, acquiring event element information and generating event element nodes to form a case map;
the matching value calculation module is used for calculating the vector similarity of the event characteristic information and the case map to obtain a matching value of the event characteristic information and the case map;
and the case matching module is used for screening similar cases of the target case from the case sample library based on the matching value.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, characterized in that the processor implements the steps of the pattern matching method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the class matching method according to any one of claims 1 to 7.
CN202210437396.0A 2022-04-25 2022-04-25 Class matching method and device, computer equipment and storage medium Active CN114547257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210437396.0A CN114547257B (en) 2022-04-25 2022-04-25 Class matching method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210437396.0A CN114547257B (en) 2022-04-25 2022-04-25 Class matching method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114547257A true CN114547257A (en) 2022-05-27
CN114547257B CN114547257B (en) 2022-07-19

Family

ID=81666816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210437396.0A Active CN114547257B (en) 2022-04-25 2022-04-25 Class matching method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114547257B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116070624A (en) * 2023-04-06 2023-05-05 中南大学 Class case pushing method based on environment-friendly case elements
CN117851608A (en) * 2024-01-06 2024-04-09 杭州威灿科技有限公司 Case map generation method, device, equipment and medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150363509A1 (en) * 2014-06-13 2015-12-17 Yahoo! Inc. Entity Generation Using Queries
US20160224637A1 (en) * 2013-11-25 2016-08-04 Ut Battelle, Llc Processing associations in knowledge graphs
CN107908671A (en) * 2017-10-25 2018-04-13 南京擎盾信息科技有限公司 Knowledge mapping construction method and system based on law data
CN108038091A (en) * 2017-10-30 2018-05-15 上海思贤信息技术股份有限公司 A kind of similar calculating of judgement document's case based on figure and search method and system
US20190155940A1 (en) * 2017-11-17 2019-05-23 Accenture Global Solutions Limited Real-time prediction and explanation of sequences of abnormal events
CN110737821A (en) * 2018-07-03 2020-01-31 百度在线网络技术(北京)有限公司 Similar event query method, device, storage medium and terminal equipment
CN111241241A (en) * 2020-01-08 2020-06-05 平安科技(深圳)有限公司 Case retrieval method, device and equipment based on knowledge graph and storage medium
US20210103256A1 (en) * 2019-09-06 2021-04-08 Intelligent Fusion Technology, Inc. Decision support method and apparatus for machinery control
CN113407729A (en) * 2021-05-11 2021-09-17 银江股份有限公司 Judicial-oriented personalized case recommendation method and system
CN114092283A (en) * 2021-10-28 2022-02-25 湘潭大学 Knowledge graph matching-based legal case similarity calculation method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160224637A1 (en) * 2013-11-25 2016-08-04 Ut Battelle, Llc Processing associations in knowledge graphs
US20150363509A1 (en) * 2014-06-13 2015-12-17 Yahoo! Inc. Entity Generation Using Queries
CN107908671A (en) * 2017-10-25 2018-04-13 南京擎盾信息科技有限公司 Knowledge mapping construction method and system based on law data
CN108038091A (en) * 2017-10-30 2018-05-15 上海思贤信息技术股份有限公司 A kind of similar calculating of judgement document's case based on figure and search method and system
US20190155940A1 (en) * 2017-11-17 2019-05-23 Accenture Global Solutions Limited Real-time prediction and explanation of sequences of abnormal events
CN110737821A (en) * 2018-07-03 2020-01-31 百度在线网络技术(北京)有限公司 Similar event query method, device, storage medium and terminal equipment
US20210103256A1 (en) * 2019-09-06 2021-04-08 Intelligent Fusion Technology, Inc. Decision support method and apparatus for machinery control
CN111241241A (en) * 2020-01-08 2020-06-05 平安科技(深圳)有限公司 Case retrieval method, device and equipment based on knowledge graph and storage medium
CN113407729A (en) * 2021-05-11 2021-09-17 银江股份有限公司 Judicial-oriented personalized case recommendation method and system
CN114092283A (en) * 2021-10-28 2022-02-25 湘潭大学 Knowledge graph matching-based legal case similarity calculation method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YONGJUN WANG;JING GAO: "Case Recommendation Algorithm of Discipline Inspection and Supervision based on Knowledge Graph", 《2021 2ND INTERNATIONAL CONFERENCE ON ELECTRONICS, COMMUNICATIONS AND INFORMATION TECHNOLOGY (CECIT)》 *
李培峰,周国栋,朱巧明: "基于语义的中文事件触发词抽取联合模型", 《北大核心》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116070624A (en) * 2023-04-06 2023-05-05 中南大学 Class case pushing method based on environment-friendly case elements
CN117851608A (en) * 2024-01-06 2024-04-09 杭州威灿科技有限公司 Case map generation method, device, equipment and medium

Also Published As

Publication number Publication date
CN114547257B (en) 2022-07-19

Similar Documents

Publication Publication Date Title
US11227118B2 (en) Methods, devices, and systems for constructing intelligent knowledge base
WO2022116537A1 (en) News recommendation method and apparatus, and electronic device and storage medium
CN111666401B (en) Document recommendation method, device, computer equipment and medium based on graph structure
CN109885773B (en) Personalized article recommendation method, system, medium and equipment
CN114547257B (en) Class matching method and device, computer equipment and storage medium
CN111797214A (en) FAQ database-based problem screening method and device, computer equipment and medium
CN111539197A (en) Text matching method and device, computer system and readable storage medium
CN112559895B (en) Data processing method and device, electronic equipment and storage medium
CN114780746A (en) Knowledge graph-based document retrieval method and related equipment thereof
CN112070550A (en) Keyword determination method, device and equipment based on search platform and storage medium
CN114399396A (en) Insurance product recommendation method and device, computer equipment and storage medium
CN115795030A (en) Text classification method and device, computer equipment and storage medium
CN114416998A (en) Text label identification method and device, electronic equipment and storage medium
CN109086386B (en) Data processing method, device, computer equipment and storage medium
CN113569118A (en) Self-media pushing method and device, computer equipment and storage medium
CN115859964B (en) Educational resource sharing method and system based on educational cloud platform
CN109918661B (en) Synonym acquisition method and device
CN113961811B (en) Event map-based conversation recommendation method, device, equipment and medium
CN113011153B (en) Text correlation detection method, device, equipment and storage medium
CN115408523A (en) Medium-length and long-text classification method and system based on abstract extraction and keyword extraction
CN112148902B (en) Data processing method, device, server and storage medium
CN111985217B (en) Keyword extraction method, computing device and readable storage medium
CN114528378A (en) Text classification method and device, electronic equipment and storage medium
CN112149389A (en) Resume information structured processing method and device, computer equipment and storage medium
CN112148855A (en) Intelligent customer service problem retrieval method, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant