CN114637822A - Legal information query method, device, equipment and storage medium - Google Patents

Legal information query method, device, equipment and storage medium Download PDF

Info

Publication number
CN114637822A
CN114637822A CN202210253772.0A CN202210253772A CN114637822A CN 114637822 A CN114637822 A CN 114637822A CN 202210253772 A CN202210253772 A CN 202210253772A CN 114637822 A CN114637822 A CN 114637822A
Authority
CN
China
Prior art keywords
legal
words
dependency
word segmentation
preset
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.)
Pending
Application number
CN202210253772.0A
Other languages
Chinese (zh)
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.)
Ping An International Smart City Technology Co Ltd
Original Assignee
Ping An International Smart City Technology Co Ltd
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 Ping An International Smart City Technology Co Ltd filed Critical Ping An International Smart City Technology Co Ltd
Priority to CN202210253772.0A priority Critical patent/CN114637822A/en
Publication of CN114637822A publication Critical patent/CN114637822A/en
Pending legal-status Critical Current

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/3332Query translation
    • G06F16/3334Selection or weighting of terms from queries, including natural language queries
    • 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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • 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
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • 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/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/18Legal services; Handling legal documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Tourism & Hospitality (AREA)
  • Molecular Biology (AREA)
  • Marketing (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Technology Law (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Computation (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Mathematical Physics (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Biophysics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to an artificial intelligence technology, and discloses a legal information query method, which comprises the following steps: performing word segmentation screening and entity identification on legal document data to obtain a plurality of legal entities; constructing a plurality of legal dependency trees according to legal file data, and taking the legal dependency trees which are matched and consistent with a plurality of legal entities in the legal dependency trees as target dependency trees; analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map; storing the legal knowledge map in a map database, inquiring corresponding legal information from the legal knowledge map when receiving an information inquiry request sent by a request end, and returning the legal information to the request end. In addition, the invention also relates to a block chain technology, and the analytic triples can be stored in the nodes of the block chain. The invention also provides a legal information inquiry device, electronic equipment and a storage medium. The invention can improve the efficiency of legal information inquiry.

Description

Legal information query method, device, equipment and storage medium
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a legal information query method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Now entering the era of the internet of things, daily production of each enterprise inevitably involves knowledge related to environmental protection and inquiry of laws and regulations. Because the information amount contained in the laws and regulations is huge, and each law in the laws and regulations is relatively long, the main information which each law wants to embody cannot be accurately expressed, and the time is long when a user needs to inquire the legal information. Therefore, an efficient legal information query method needs to be provided.
Disclosure of Invention
The invention provides a legal information query method, a legal information query device and a computer-readable storage medium, and mainly aims to improve the efficiency of legal information query.
In order to achieve the above object, the present invention provides a legal information query method, which comprises:
obtaining legal document data, and performing word segmentation screening on the legal document data to obtain a plurality of legal words;
performing entity recognition on the plurality of legal participles based on a preset named entity recognition algorithm to obtain a plurality of legal entities;
constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency trees which are matched and consistent with a plurality of legal entities in the legal dependency trees as target dependency trees;
analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map;
and when an information query request sent by a request end is received, querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end.
Optionally, the building a plurality of legal dependency trees from the legal document data includes:
splitting the legal document data into a plurality of legal sentences respectively, and extracting words with preset parts of speech in the legal sentences;
and taking the head words and the tail words in the words with the preset parts of speech and arranged in the corresponding legal sentences as child nodes of a preset dependency tree, and removing the words with the head words and the tail words as root nodes to obtain a plurality of legal dependency trees.
Optionally, the entity recognition is performed on the plurality of legal segmented words based on a preset named entity recognition algorithm to obtain a plurality of legal entities, including:
vectorizing the plurality of legal participles respectively to obtain a plurality of participle vectors;
inputting a plurality of word segmentation vectors into a long-term and short-term memory network for feature extraction to obtain a feature sequence representation;
inputting the characteristic sequence representation into a CRF layer for decoding to obtain a sequence corresponding to each legal word segmentation;
and determining the corresponding legal entity according to the sequence corresponding to the legal word segmentation.
Optionally, the inputting a plurality of the word segmentation vectors into a long-term and short-term memory network for feature extraction to obtain a feature sequence characterization includes:
calculating the state value of the word segmentation vector through an input gate in the long-short term memory network;
calculating an activation value of the word segmentation vector through a forgetting gate in the long-short term memory network;
calculating a state update value of the participle vector according to the state value and the activation value;
and calculating the characteristic sequence representation corresponding to the state updating value by utilizing an output gate in the long-short term memory network.
Optionally, the inputting the characteristic sequence representation into a CRF layer for decoding to obtain a sequence corresponding to each legal participle includes:
extracting probability transition matrix parameters in the CRF layer and acquiring a preset real label sequence;
and predicting the characteristic sequence characterization, the real label sequence and the probability transition matrix parameter based on a Viterbi algorithm to obtain a sequence corresponding to each legal word.
Optionally, the performing word segmentation and screening on the legal document data to obtain a plurality of legal words comprises:
respectively carrying out sentence dividing processing on the legal document data by taking a preset symbol as a dividing point to obtain a legal sentence subset;
performing word segmentation processing on the legal sentence set by using a preset reference word segmentation device to obtain a word segmentation set;
and performing part-of-speech tagging on the multiple participles in the participle set, and taking the participles which accord with the preset part-of-speech as legal participles.
Optionally, the taking a legal dependency tree of the legal dependency trees that matches and is consistent with the legal entities as a target dependency tree includes:
matching words of child nodes and root nodes in the legal dependency trees with the legal entities;
and when the words in the child nodes or the root nodes in the plurality of legal dependency trees are matched with any legal entity in the plurality of legal entities, taking the legal decision tree to which the matched words belong as a target dependency tree.
In order to solve the above problem, the present invention also provides a legal information inquiry apparatus, comprising:
the entity identification module is used for acquiring legal document data, performing word segmentation and screening on the legal document data to obtain a plurality of legal words, and performing entity identification on the legal words based on a preset named entity identification algorithm to obtain a plurality of legal entities;
the dependency tree construction module is used for constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency trees which are matched and consistent with the legal entities in the legal dependency trees as target dependency trees;
the knowledge map generation module is used for analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map;
and the information query module is used for querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end when receiving an information query request sent by the request end.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the legal information inquiry method described above.
In order to solve the above problem, the present invention also provides a computer-readable storage medium having at least one computer program stored therein, the at least one computer program being executed by a processor in an electronic device to implement the legal information inquiry method described above.
The embodiment of the invention obtains a plurality of legal entities by performing word segmentation screening and entity identification on the legal document data, and constructs the corresponding legal dependency tree according to the legal document data, wherein the legal dependency tree can intuitively embody the data relationship in the legal document data. And taking the legal dependency tree matched with the legal entity as a target dependency tree, and screening out the dependency tree matched with the legal entity. The target dependency tree is analyzed, and the rule expansion is carried out on the analysis triple obtained through analysis, so that the legal knowledge graph is obtained, and the legal information contained in the legal knowledge graph is more comprehensive and abundant. And when an information query request sent by a request end is received, querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end. The efficiency of legal information inquiry is improved. Therefore, the legal information query method, the legal information query device, the electronic equipment and the computer-readable storage medium provided by the invention can solve the problem that the efficiency of legal information query is not high enough.
Drawings
Fig. 1 is a schematic flowchart of a legal information query method according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of a legal information inquiry apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for implementing the legal information query method according to an embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a legal information query method. The execution subject of the legal information query method includes, but is not limited to, at least one of the electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like. In other words, the legal information inquiry method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a legal information query method according to an embodiment of the present invention. In this embodiment, the legal information query method includes:
and S1, obtaining the legal document data, and performing word segmentation screening on the legal document data to obtain a plurality of legal words.
In the embodiment of the invention, the legal document data refers to various laws and regulations issued by the state and red files. Corresponding legal document data can be downloaded from various local websites or national websites. The legal document data in the scheme can be single legal document data or a plurality of legal document data.
Specifically, the performing word segmentation and screening on the legal document data to obtain a plurality of legal words comprises:
respectively carrying out sentence dividing processing on the legal document data by taking a preset symbol as a dividing point to obtain a legal sentence subset;
performing word segmentation processing on the legal sentence set by using a preset reference word segmentation device to obtain a word segmentation set;
and performing part-of-speech tagging on the multiple participles in the participle set, and taking the participles which accord with the preset part-of-speech as legal participles.
In detail, the preset symbol is a period. Because the legal document data generally contains characters with longer length, sentence splitting processing is required to be performed first, and the legal document data is divided into a plurality of sentences by using periods as dividing points to obtain legal sentence subsets. And performing word segmentation processing on the legal sentence set by using a preset reference word segmentation device to obtain a word segmentation set, wherein the reference word segmentation device can be a Chinese character coding word segmentation device. The part-of-speech tagging is tagging of a plurality of participles with corresponding part-of-speech parts, such as adjectives, nouns, adverbs, or mood-assisted words. The preset part of speech is a noun.
For example, the legal document data is patent law, and part of the contents of the second item in the patent law is as follows: the invention and creation named by the method refer to the invention, the utility model and the appearance design. The invention relates to a new technical scheme for products, methods or improvements thereof. "the legal sentence contains the invention creation called by this law in a concentrative way by using sentence numbers as dividing points, which means invention, utility model and appearance design. The invention refers to new technical scheme for products, methods or improvements thereof. The method comprises the steps of firstly, dividing a legal sentence set into two legal sentences by using a preset reference word divider, and obtaining a word set which is 'the law, the name, the creation, the meaning, the indication, the invention, the utility model, the appearance design, the invention, the indication, the product, the method or the improvement, the proposed, the new or the technical scheme'. And performing part-of-speech tagging on a plurality of participles in the participle set, for example, tagging the invention as a noun, tagging the invention as a help word, using the participle which meets the preset part-of-speech as a legal participle, and using the noun as a legal participle in the scheme, namely, the invention can be used as the legal participle.
And S2, performing entity recognition on the plurality of legal participles based on a preset named entity recognition algorithm to obtain a plurality of legal entities.
In the embodiment of the invention, the Named Entity Recognition algorithm (NER) is a very basic task in the natural language processing technology, and two most commonly used deep learning models in the Named Entity Recognition algorithm are respectively bidirectional LSTM and CRF combined for Entity Recognition or related-CNN.
Specifically, the entity recognition is performed on the plurality of legal segments based on a preset named entity recognition algorithm to obtain a plurality of legal entities, including:
vectorizing the plurality of legal participles respectively to obtain a plurality of participle vectors;
inputting a plurality of word segmentation vectors into a long-short term memory network for feature extraction to obtain a feature sequence representation;
inputting the characteristic sequence representation into a CRF layer for decoding to obtain a sequence corresponding to each legal word segmentation;
and determining the corresponding legal entity according to the sequence corresponding to the legal word segmentation.
In detail, the Long Short-Term Memory network (LSTM) is a time-cycling neural network. The long-short term memory network comprises an input gate, a forgetting gate and an output gate. The CRF layer is a conditional random field and can restrict the output data of the long-short term memory network, so that the finally obtained legal entity is more accurate.
Furthermore, the legal participles can be vectorized through a pre-training model to obtain a plurality of participle vectors, or the legal participles are input into a vectorization layer to be vectorized, or vectorization is realized by using a doc2vec algorithm. The vectorization may convert a plurality of the legal participles into a vectorization matrix suitable for computation.
Specifically, the inputting a plurality of word segmentation vectors into a long-term and short-term memory network for feature extraction to obtain a feature sequence characterization includes:
calculating the state value of the participle vector through an input gate in the long-short term memory network;
calculating an activation value of the word segmentation vector through a forgetting gate in the long-short term memory network;
calculating a state update value of the participle vector according to the state value and the activation value;
and calculating the characteristic sequence representation corresponding to the state updating value by utilizing an output gate in the long-short term memory network.
In detail, the long and short term memory network comprises an input gate, a forgetting gate and an output gate.
Specifically, the calculating, by using an output gate in the long-short term memory network, a signature sequence characterization corresponding to the state update value includes:
the signature sequence characterization was calculated using the following formula:
ot=tan h(ct)
wherein o istRepresenting a signature sequence, tan h representing an activation function of an output gate, ctRepresenting the state update value.
Further, the step of inputting the characteristic sequence characterization into a CRF layer for decoding to obtain a sequence corresponding to each legal participle includes:
extracting probability transition matrix parameters in the CRF layer and acquiring a preset real label sequence;
and predicting the characteristic sequence characterization, the real label sequence and the probability transition matrix parameter based on a Viterbi algorithm to obtain a sequence corresponding to each legal word.
In detail, the viterbi algorithm is a dynamic programming algorithm for finding the sequence of-viterbi path-hidden states that is most likely to produce the sequence of observed events.
S3, constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency tree which is matched and consistent with the legal entities in the legal dependency trees as a target dependency tree.
In an embodiment of the present invention, the constructing a plurality of legal dependency trees according to the legal document data includes:
splitting the legal document data into a plurality of legal sentences respectively, and extracting words with preset parts of speech in the legal sentences;
and taking the head words and the tail words in the words with the preset parts of speech and arranged in the corresponding legal sentences as child nodes of a preset dependency tree, and removing the words with the head words and the tail words as root nodes to obtain a plurality of legal dependency trees.
For example, if the legal terms are "invention," they refer to new technical solutions proposed for a product, a method, or an improvement thereof. And extracting words which accord with the preset part of speech to be 'invention', 'yes' and 'technical scheme', using the 'invention' and the 'technical scheme' as child nodes of the preset dependency tree, and using the 'yes' as a root node to obtain the legal dependency tree.
Specifically, the taking a legal dependency tree of the plurality of legal dependency trees that matches with a plurality of legal entities as a target dependency tree includes:
matching words of child nodes and root nodes in the legal dependency trees with the legal entities;
and when the words in the child nodes or the root nodes in the plurality of legal dependency trees are matched with any legal entity in the plurality of legal entities, taking the legal decision tree to which the matched words belong as a target dependency tree.
The legal decision trees to which the words which are matched in a consistent way belong are used as target dependency trees, one or more legal decision trees which are matched in a consistent way can be used, and therefore one or more legal decision trees can also be used as the target dependency trees.
In detail, if the legal entity is "invention", and the words of the child nodes and the root nodes in the legal dependency tree are matched, and when the words of the child nodes or the root nodes in a plurality of legal dependency trees are matched with any legal entity in the plurality of legal entities, the "invention" and the "technical scheme" are used as child nodes of a preset dependency tree, and the "yes" is used as a legal dependency tree of the root node.
And S4, analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge graph.
In this embodiment of the present invention, the analyzing the target dependency tree to obtain an analysis triple includes:
respectively taking the words corresponding to the child nodes in the target dependency tree as a head entity and a tail entity, and taking the words corresponding to the root node in the target dependency tree as an entity relationship;
and inputting the head entity, the tail entity and the entity relation into a preset triple template to obtain an analytic triple.
In detail, the triple template is [ head entity, entity relationship, tail entity ].
For example, the words corresponding to the child nodes in the target dependency tree are "invention" and "technical solution", the "invention" is used as a head entity, the "technical solution" is used as a tail entity, the root node in the target dependency tree is "yes", the "yes" is used as an entity relationship, and the head entity, the tail entity and the entity relationship are input into a preset triple template [ head entity, entity relationship, tail entity ] to obtain an analytic triple [ invention, yes, technical solution ].
Specifically, the rule extension is performed according to the analysis triple to obtain the legal knowledge graph, and the method comprises the following steps:
judging whether the analytic triples with the same entity exist in a plurality of different analytic triples;
and if so, splicing the triples with the same entity in the analysis triples to obtain the legal knowledge graph.
In detail, if the multiple parsing triples are [ head entity a, entity relationship AB, tail entity B ], [ head entity a, entity relationship AC, tail entity C ], and [ head entity D, entity relationship DE, tail entity E ], respectively. Because the analytic triple [ head entity A, entity relation AB, tail entity B ] and the analytic triple [ head entity A, entity relation AC, tail entity C ] contain the same head entity A, the [ head entity A, entity relation AB, tail entity B ] and the [ head entity A, entity relation AC, tail entity C ] are spliced together, the corresponding tail entity is connected by taking the head entity A as the center and the entity relation AB and the entity relation AC as connecting lines, and the legal knowledge graph is obtained.
And S5, when receiving an information query request sent by a request end, querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end.
In the embodiment of the invention, the legal knowledge map can be stored in a preset map database, the preset map database can be Neo4J, the database is a world-leading open source graphic database, and the data source structure can be conveniently stored and read. Neo4j is a high-performance, NOSQL graph database that stores structured data on a network rather than in tables. It is an embedded, disk-based Java persistence engine with full transactional features.
Specifically, after the corresponding legal information is queried from the legal knowledge base, the method further includes:
and displaying and pushing the legal information according to a preset data display form.
In detail, the data display is carried out through the display mode of () - [ ] - >, the relationship between the entities can be clear at a glance, each entity has a type, and the data related to the current data can be inquired through the type.
The embodiment of the invention obtains a plurality of legal entities by performing word segmentation screening and entity identification on the legal document data, and constructs the corresponding legal dependency tree according to the legal document data, wherein the legal dependency tree can intuitively embody the data relationship in the legal document data. And taking the legal dependency tree matched with the legal entity as a target dependency tree, and screening out the dependency tree matched with the legal entity. The target dependency tree is analyzed, and the rule expansion is carried out on the analysis triple obtained through analysis, so that the legal knowledge graph is obtained, and the legal information contained in the legal knowledge graph is more comprehensive and abundant. And when an information query request sent by a request end is received, querying corresponding legal information from the legal knowledge map and returning the legal information to the request end. The efficiency of legal information inquiry is improved. Therefore, the legal information query method provided by the invention can solve the problem that the efficiency of legal information query is not high enough.
Fig. 2 is a functional block diagram of a legal information inquiry apparatus according to an embodiment of the present invention.
The legal information inquiry apparatus 100 according to the present invention may be installed in an electronic device. According to the realized functions, the legal information inquiry apparatus 100 may include an entity identification module 101, a dependency tree construction module 102, a knowledge graph generation module 103, and an information inquiry module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the entity identification module 101 is configured to obtain legal document data, perform word segmentation and screening on the legal document data to obtain a plurality of legal words, and perform entity identification on the plurality of legal words based on a preset named entity identification algorithm to obtain a plurality of legal entities;
the dependency tree construction module 102 is configured to construct a plurality of legal dependency trees according to the legal file data, and use a legal dependency tree, which is matched and consistent with a plurality of legal entities, in the legal dependency trees as a target dependency tree;
the knowledge graph generating module 103 is configured to analyze the target dependency tree to obtain an analysis triple, and perform rule expansion according to the analysis triple to obtain a legal knowledge graph;
the information query module 104 is configured to, when receiving an information query request sent by a request end, query corresponding legal information from the legal knowledge base and return the legal information to the request end.
In detail, when the modules in the legal information query device 100 according to the embodiment of the present invention are used, the same technical means as the legal information query method described in fig. 1 above are adopted, and the same technical effects can be produced, which is not described herein again.
Fig. 3 is a schematic structural diagram of an electronic device for implementing a legal information query method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a legal information inquiry program, stored in the memory 11 and operable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (for example, executing a legal information inquiry program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of legal information inquiry programs, etc., but also to temporarily store data that has been output or will be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 3 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The legal information inquiry program stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when executed in the processor 10, can realize:
obtaining legal document data, and performing word segmentation screening on the legal document data to obtain a plurality of legal words;
performing entity recognition on the plurality of legal participles based on a preset named entity recognition algorithm to obtain a plurality of legal entities;
constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency trees which are matched and consistent with a plurality of legal entities in the legal dependency trees as target dependency trees;
analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map;
and when an information query request sent by a request end is received, querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
obtaining legal document data, and performing word segmentation screening on the legal document data to obtain a plurality of legal words;
performing entity recognition on the plurality of legal participles based on a preset named entity recognition algorithm to obtain a plurality of legal entities;
constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency trees which are matched and consistent with a plurality of legal entities in the legal dependency trees as target dependency trees;
analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map;
and when an information query request sent by a request end is received, querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A legal information inquiry method, comprising:
obtaining legal document data, and performing word segmentation screening on the legal document data to obtain a plurality of legal words;
performing entity recognition on the plurality of legal participles based on a preset named entity recognition algorithm to obtain a plurality of legal entities;
constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency trees which are matched and consistent with a plurality of legal entities in the legal dependency trees as target dependency trees;
analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map;
and when an information query request sent by a request end is received, querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end.
2. The legal information query method of claim 1, wherein the building a plurality of legal dependency trees from the legal document data comprises:
splitting the legal document data into a plurality of legal sentences respectively, and extracting words with preset parts of speech in the legal sentences;
and taking the head words and the tail words in the words with the preset parts of speech and arranged in the corresponding legal sentences as child nodes of a preset dependency tree, and removing the words with the head words and the tail words as root nodes to obtain a plurality of legal dependency trees.
3. The legal information query method of claim 1, wherein the entity recognition of the plurality of legal segments based on a preset named entity recognition algorithm to obtain a plurality of legal entities comprises:
vectorizing the plurality of legal participles respectively to obtain a plurality of participle vectors;
inputting a plurality of word segmentation vectors into a long-term and short-term memory network for feature extraction to obtain a feature sequence representation;
inputting the characteristic sequence representation into a CRF layer for decoding to obtain a sequence corresponding to each legal word segmentation;
and determining the corresponding legal entity according to the sequence corresponding to the legal word segmentation.
4. The legal information inquiry method of claim 3, wherein said inputting a plurality of said segmentation vectors into a long-short term memory network for feature extraction to obtain a feature sequence representation comprises:
calculating the state value of the word segmentation vector through an input gate in the long-short term memory network;
calculating an activation value of the word segmentation vector through a forgetting gate in the long-short term memory network;
calculating a state update value of the participle vector according to the state value and the activation value;
and calculating the characteristic sequence representation corresponding to the state updating value by utilizing an output gate in the long-short term memory network.
5. The legal information inquiry method of claim 3, wherein said inputting the characteristic sequence representation into a CRF layer for decoding to obtain the sequence corresponding to each legal participle comprises:
extracting probability transition matrix parameters in the CRF layer and acquiring a preset real label sequence;
and predicting the characteristic sequence characterization, the real label sequence and the probability transition matrix parameter based on a Viterbi algorithm to obtain a sequence corresponding to each legal word.
6. The legal information inquiry method of claim 1, wherein the performing word segmentation screening on the legal document data to obtain a plurality of legal words comprises:
respectively carrying out sentence dividing processing on the legal document data by taking a preset symbol as a dividing point to obtain a legal sentence subset;
performing word segmentation processing on the legal sentence set by using a preset reference word segmentation device to obtain a word segmentation set;
and performing part-of-speech tagging on a plurality of participles in the participle set, and taking the participles which accord with the preset part-of-speech as legal participles.
7. The legal information query method of any one of claims 1-6, wherein the taking a legal dependency tree of the plurality of legal dependency trees that matches a plurality of the legal entities as a target dependency tree comprises:
matching words of child nodes and root nodes in the legal dependency trees with the legal entities;
and when the words in the child nodes or the root nodes in the plurality of legal dependency trees are matched with any legal entity in the plurality of legal entities, taking the legal decision tree to which the matched words belong as a target dependency tree.
8. A legal information inquiry apparatus, comprising:
the entity identification module is used for acquiring legal document data, performing word segmentation and screening on the legal document data to obtain a plurality of legal words, and performing entity identification on the legal words based on a preset named entity identification algorithm to obtain a plurality of legal entities;
the dependency tree construction module is used for constructing a plurality of legal dependency trees according to the legal file data, and taking the legal dependency trees which are matched and consistent with the legal entities in the legal dependency trees as target dependency trees;
the knowledge map generation module is used for analyzing the target dependency tree to obtain an analysis triple, and performing rule expansion according to the analysis triple to obtain a legal knowledge map;
and the information query module is used for querying corresponding legal information from the legal knowledge graph and returning the legal information to the request end when receiving an information query request sent by the request end.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the legal information inquiry method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the legal information inquiry method of any one of claims 1 to 7.
CN202210253772.0A 2022-03-15 2022-03-15 Legal information query method, device, equipment and storage medium Pending CN114637822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210253772.0A CN114637822A (en) 2022-03-15 2022-03-15 Legal information query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210253772.0A CN114637822A (en) 2022-03-15 2022-03-15 Legal information query method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114637822A true CN114637822A (en) 2022-06-17

Family

ID=81948598

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210253772.0A Pending CN114637822A (en) 2022-03-15 2022-03-15 Legal information query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114637822A (en)

Similar Documents

Publication Publication Date Title
CN112541338A (en) Similar text matching method and device, electronic equipment and computer storage medium
CN112883190A (en) Text classification method and device, electronic equipment and storage medium
CN113821622B (en) Answer retrieval method and device based on artificial intelligence, electronic equipment and medium
CN114979120B (en) Data uploading method, device, equipment and storage medium
CN115238670B (en) Information text extraction method, device, equipment and storage medium
CN112667775A (en) Keyword prompt-based retrieval method and device, electronic equipment and storage medium
CN114840684A (en) Map construction method, device and equipment based on medical entity and storage medium
CN113344125B (en) Long text matching recognition method and device, electronic equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN114416939A (en) Intelligent question and answer method, device, equipment and storage medium
CN113706322A (en) Service distribution method, device, equipment and storage medium based on data analysis
CN113420542B (en) Dialogue generation method, device, electronic equipment and storage medium
CN113806492B (en) Record generation method, device, equipment and storage medium based on semantic recognition
CN114780688A (en) Text quality inspection method, device and equipment based on rule matching and storage medium
CN114943306A (en) Intention classification method, device, equipment and storage medium
CN114138243A (en) Function calling method, device, equipment and storage medium based on development platform
CN114518993A (en) System performance monitoring method, device, equipment and medium based on business characteristics
CN114637822A (en) Legal information query method, device, equipment and storage medium
CN112632264A (en) Intelligent question and answer method and device, electronic equipment and storage medium
CN111414452A (en) Search word matching method and device, electronic equipment and readable storage medium
CN115525730B (en) Webpage content extraction method and device based on page weighting and electronic equipment
CN113723114A (en) Semantic analysis method, device and equipment based on multi-intent recognition and storage medium
CN114610807A (en) Data import template configuration method, device, equipment and storage medium
CN114168836A (en) Webpage data analysis and visualization method and device, electronic equipment and medium
CN113627187A (en) Named entity recognition method and device, electronic equipment and readable 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