CN111723188A - Sentence display method and electronic equipment based on artificial intelligence for question-answering system - Google Patents
Sentence display method and electronic equipment based on artificial intelligence for question-answering system Download PDFInfo
- Publication number
- CN111723188A CN111723188A CN202010580653.7A CN202010580653A CN111723188A CN 111723188 A CN111723188 A CN 111723188A CN 202010580653 A CN202010580653 A CN 202010580653A CN 111723188 A CN111723188 A CN 111723188A
- Authority
- CN
- China
- Prior art keywords
- sentence
- candidate target
- input
- statement
- target
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Machine Translation (AREA)
Abstract
The embodiment of the disclosure discloses a sentence display method and electronic equipment based on artificial intelligence for a question-answering system. One embodiment of the method comprises: acquiring an input statement; determining target entity information based on the input statement; generating a candidate target statement set based on target entity information and a pre-obtained knowledge graph; for each candidate target statement in the candidate target statement set, matching the candidate target statement with the input statement to generate a semantic relation value of the candidate target statement and the input statement to obtain a semantic relation value set of the input statement; and determining and outputting a target statement of the input statement based on the semantic relation value set. The method determines the candidate target statement set according to the target entity information, and improves the accuracy of problem judgment. And determining and outputting the target sentence according to the semantic relation value of the candidate target sentence and the input sentence, so that the performance of the sentence output task is improved, and the output sentence is more in line with the requirement of a question-answering system.
Description
Technical Field
The embodiment of the disclosure relates to the field of text processing, in particular to a method and electronic equipment for sentence generation.
Background
Natural language processing is artificial intelligence and is an important research direction and also an important application field. The automatic generation of answer sentences according to input question sentences in a question-answering system is an important field of natural language processing technology application and is also an important way for improving the performance of intelligent customer service and automatic question-answering systems. The question content is accurately judged, reasonable answer sentences are provided, and the application performance of the question-answering system can be improved.
Disclosure of Invention
The embodiment of the disclosure provides a sentence display method based on artificial intelligence for a question-answering system.
In a first aspect, the disclosed embodiments provide an artificial intelligence-based statement display method for a question-answering system, the method including: acquiring an input statement; determining target entity information based on the input sentence, wherein the target entity information is a keyword in the input sentence; generating a candidate target statement set based on target entity information and a pre-obtained knowledge graph; for each candidate target statement in the candidate target statement set, matching the candidate target statement with the input statement to generate a semantic relation value of the candidate target statement and the input statement to obtain a semantic relation value set of the input statement; and determining and outputting a target statement of the input statement based on the semantic relation value set.
In some embodiments, the method further comprises: and sending the target sentence to a device supporting display, and controlling the device to display the target sentence.
In some embodiments, the target entity information refers to a set of characters contained by a node in the knowledge-graph; and determining target entity information based on the input statement, including: performing word segmentation on an input sentence to obtain a word segmentation set included by the input sentence; and generating target entity information based on the word segmentation set.
In some embodiments, generating the target entity information based on the set of participles comprises: for each participle in the participle set, generating a word vector of the participle, and determining the word vector as a score of target entity information of the input sentence to obtain a score set of the participle set; and determining the participle in the participle set corresponding to the score with the maximum value in the score set as the target entity information.
In some embodiments, the pre-derived knowledge-graph comprises nodes and edges, wherein the nodes comprise entity information and the edges represent relationships between different nodes; and generating a candidate target statement set based on the target entity information and a pre-obtained knowledge graph, wherein the candidate target statement set comprises: finding a graph structure set corresponding to the target entity information in a pre-obtained knowledge graph; for each graph structure in the graph structure set, extracting triple data of the graph structure to obtain a triple data set of the target entity information; and determining the triple data set as a candidate target statement set.
In some embodiments, for each candidate target sentence in the set of candidate target sentences, matching the candidate target sentence with the input sentence, generating a semantic relationship value of the candidate target sentence with the input sentence, comprises: for the candidate target sentence and the input sentence, a character coincidence degree is calculated using the following formula:where c _ o represents the degree of coincidence of characters of Q and A, len () represents the function of calculating the number of characters, Q represents the input sentence, A represents the candidate target sentence, Q ∩ A represents the same character set of Q and A, len (Q ∩ A) represents the number of characters in the same character set of Q and A, Q ∪ A represents the collection of characters of Q and A, len (Q ∪ A) represents the number of characters in the collection of characters of Q and A, and for the candidate target sentence and the input sentence, the edit distance ratio is calculated using the following formula:wherein edp represents the ratio of the edit distance between Q and A, len () represents the function of calculating the number of characters, Q represents the input sentence, A represents the candidate target sentence, len (Q ∪ A) represents the number of characters in the collection of characters in Q and A, ed (Q, A) represents the number of characters to be edited and modified for converting Q to A, converting the candidate target sentence to a first word vector, converting the input sentence to a second word vector, calculating the degree of difference using the following formula:
where Sim represents the calculated degree of difference between Q and a, Q represents the input sentence, a represents the candidate target sentence, I represents the first word vector, R represents the second word vector, | I | represents the length of I, | R | represents the length of R, CosDis (,) represents a function of the distance between the calculation element and the cosine of the vector, ω represents the element, ω represents the input sentence, and I represents the candidate target sentence1Representing an element, ω, in a first word vector2Representing elements in the second word vector, α representing arguments, α being an arbitrary integer, max () representing the maximum value, min () representing the minimum value, CosDis (ω, R) representing ω2And the cosine distance between R, max (α× CosDis (ω)2R)) means to take α× CosDis (omega)2Maximum value of R), min (max (α× CosDis (ω)2R)),1) represents max (α× CosDis (ω)2R)) and 1,represents the sum of all elements in I and the differences of R, CosDis (omega)1I) represents omega1And the cosine distance between I, max (α× CosDis (ω)1I)) means α× CosDis (ω)1Maximum value of I), min (max (α× CosDis (ω)1I)),1) represents taking max (α× CosDis (ω)1, I)) and the minimum of 1,represents the sum of differences of all elements in R and I; and generating a semantic relation value of the candidate target sentence and the input sentence based on the character overlap ratio, the editing distance ratio and the difference degree.
In a second aspect, some embodiments of the present disclosure provide a sentence display apparatus for a question-answering system, including: a receiving unit configured to acquire an input sentence; a first generation unit configured to determine target entity information based on an input sentence, wherein the target entity information is a keyword in the input sentence; a second generation unit configured to generate a candidate target sentence set based on the target entity information and a previously obtained knowledge graph; a third generating unit, configured to, for each candidate target sentence in the candidate target sentence set, match the candidate target sentence with the input sentence, generate a semantic relation value between the candidate target sentence and the input sentence, and obtain a semantic relation value set of the input sentence; a determination unit configured to determine and output a target sentence of the input sentence based on the semantic relation value set.
In a third aspect, an embodiment of the present disclosure provides a terminal device, where the terminal device includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method as described in any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
The embodiment of the present disclosure provides a sentence display apparatus for a question-answering system, which acquires an input sentence; determining target entity information based on the input statement; generating a candidate target statement set based on target entity information and a pre-obtained knowledge graph; for each candidate target statement in the candidate target statement set, matching the candidate target statement with the input statement to generate a semantic relation value of the candidate target statement and the input statement to obtain a semantic relation value set of the input statement; and determining and outputting a target statement of the input statement based on the semantic relation value set.
One of the above-described various embodiments of the present disclosure has the following advantageous effects: and generating a candidate target sentence set of the question-answering system according to the target entity information and a pre-obtained knowledge graph. The candidate target sentences in the candidate target sentence set are candidate answer sentences for the input sentences of the question-answering system. According to the embodiment of the disclosure, the candidate target statement set is determined according to the target entity information, so that the accuracy of problem judgment can be improved. And determining and outputting the target sentence of the input sentence according to the semantic relation value between the candidate target sentence and the input sentence, so that the performance of the sentence output task is improved, and the output sentence is more in line with the requirement of a question-answering system.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an architectural diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram of some embodiments of an artificial intelligence based sentence display method for a question-answering system according to the present disclosure;
FIG. 3 is a schematic block diagram of some embodiments of a sentence display apparatus for a question-answering system according to the present disclosure;
FIG. 4 is a schematic block diagram of a computer system suitable for use as a server for implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the artificial intelligence based statement display method for question-answering systems of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a file storage application, a data analysis application, a natural language processing application, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various terminal devices having a display screen, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the above-listed terminal apparatuses. It may be implemented as multiple software or software modules (e.g., to provide inputs for statements, etc.), or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a server that stores target sentences input by the terminal apparatuses 101, 102, 103, and the like. The server can store and display the received target sentence and feed back the processing result to the terminal equipment.
It should be noted that the sentence display method based on artificial intelligence for the question-answering system provided by the embodiment of the present disclosure may be executed by the server 105, or may be executed by the terminal device.
It should be noted that the server 105 may also store the statements locally and the server 105 may directly extract the locally input statements and generate the corresponding target statements, in which case the exemplary system architecture 100 may not include the terminal devices 101, 102, 103 and the network 104.
It should be noted that the terminal apparatuses 101, 102, and 103 may also have a natural language processing application installed therein, and in this case, the processing method may also be executed by the terminal apparatuses 101, 102, and 103. At this point, the exemplary system architecture 100 may also not include the server 105 and the network 104.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, for providing natural language processing services), or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of some embodiments of an artificial intelligence based sentence display method for a question-answering system is shown, in accordance with the present disclosure. The sentence display method based on artificial intelligence for the question-answering system comprises the following steps:
In some embodiments, an execution subject (e.g., the terminal device shown in fig. 1) of the artificial intelligence-based sentence display method for the question-answering system may directly acquire an input sentence of the question-answering system. Alternatively, the input sentence may be a question sentence. The input sentence may be a question sentence of arbitrary content. For example, the input statement may be a question statement regarding a geographic relationship.
The input sentence may be uploaded to the execution body by a terminal device (for example, terminal devices 101, 102, and 103 shown in fig. 1) communicatively connected to the execution body through a wired connection or a wireless connection, or may be locally stored in the execution body. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
In some embodiments, the execution body determines the target entity information based on the input sentence. The target entity information is a keyword in the input sentence. Optionally, the target entity information refers to a character set included in a node in the knowledge graph. The knowledge-graph comprises nodes and edges, wherein the nodes comprise entity information, and the edges represent the relationship between different nodes. The knowledge-graph may be graph structure data, where each node includes entity information, which may correspond to a particular thing. In particular, the nodes in the knowledge-graph may include, but are not limited to, one of: question objects, question transactions, question objects, etc. associated with the question-and-answer system. The character sets contained by the nodes in the knowledge-graph may be character sets that describe an entity, including but not limited to one of: description characters of question objects of the question-answering system, definition characters of question affairs of the question-answering system, description characters of question objects of the question-answering system, and the like.
Optionally, the input sentence is segmented to obtain a segmentation set included in the input sentence. Specifically, segmenting the Chinese sentence into meaningful words is the process of segmenting words. The segmentation method for word segmentation can be dictionary matching-based segmentation, word frequency statistics-based segmentation and knowledge understanding-based segmentation. Specifically, based on the segmentation of dictionary matching, all words in a predetermined dictionary are searched word by word in a sentence from long to short until the sentence is finished. Segmentation based on word frequency statistics word segments are identified and segmented according to statistical information of words, including but not limited to information between adjacent words, word frequency, co-occurrence information of adjacent words, and the like. Knowledge understanding based segmentation is based on syntax and grammar analysis of a sentence, and combined with semantic analysis, words are defined and segmented through analysis of information provided by context content of the sentence.
Optionally, the target entity information is generated based on the word segmentation set. For each score in the set of participlesAnd generating a word vector of the participle, determining the word vector as a score of the target entity information of the input sentence, and obtaining a score set of the participle set. Alternatively, the executing agent may generate the word vector for the segmented word in a variety of ways. For example, a word vector of the word segmentation is obtained by inputting the word segmentation into a pre-trained deep neural network model. For another example, the word vector of the word segmentation is obtained by searching in a predefined embedding matrix. The word vector set forth above may be a word vector resulting from word-by-word embedding of the participle. Word embedding isNatural language processing(Natural Language Processing, NLP)Language modelAndwatch (A) Sign learningThe technology is generally called. Conceptually, it refers to a high-dimensional space in which one dimension is the number of all wordsEmbeddingTo a much lower dimension of continuityVector spaceIn (3), each participle is mapped asReal number fieldThe vector of (c). Specifically, a word vector (word vector) may be a vector in which a participle or a sentence is mapped to a real number by a word embedding method. Conceptually, it involves mathematical embedding from a one-dimensional space of each participle into a continuous vector space with lower dimensions.
Optionally, for a word vector of each participle in the participle set, the following step one is performed, and the word vector is determined as a score of the target entity information of the input sentence.
The method comprises the following steps: and inputting the word vector into a pre-trained neural network to generate the characteristics of the word vector. The pre-trained neural network includes a first neural network, a second neural network, and a first fully-connected layer. And inputting the word vector into a first neural network trained in advance to obtain a first feature vector. And inputting the word vector into a pre-trained second neural network to obtain a second feature vector. And splicing the first feature vector and the second feature vector to obtain a fusion feature vector. And inputting the fused feature vector into a pre-trained first full-connection layer to generate the feature of the word vector. The features of the word vector are input into the classifier, and the obtained output is determined as the score of the word vector as the target entity information of the input sentence. In particular, the classifier may be a softmax classifier.
And for the word vector of each participle in the participle set, the score of the word vector serving as target entity information of the input sentence is obtained after the step I is executed. And finally, obtaining a score set of the word segmentation set.
And determining the participle in the participle set corresponding to the score with the maximum value in the score set as the target entity information.
In some embodiments, the executing entity finds a graph structure set corresponding to the target entity information in a pre-obtained knowledge graph. Optionally, the pre-obtained knowledge-graph includes nodes and edges. Wherein the nodes comprise entity information and the edges represent relationships between different nodes.
And for each graph structure in the graph structure set, extracting the triple data of the graph structure to obtain a triple data set of the target entity information. And determining the triple data set as a candidate target statement set.
Specifically, the target entity information "beijing" is determined. According to a map structure set corresponding to 'Beijing' in the acquired knowledge map, triple data 'Beijing, capital, China', 'Beijing, city, China', 'Beijing, location, north', 'Beijing, administrative division, direct-jurisdictional city', 'Beijing, status, economic center', and the like can be acquired. The triple set may be determined as a candidate target statement set. Specifically, the triple set may correspond to the candidate target sentences "beijing is the capital of china", "beijing is a city of china", "beijing is in the north of china", "beijing is a prefecture city divided by administrative district of beijing", "beijing is an economic center of china", and so on.
In some embodiments, the executing entity performs the following step two for each candidate target sentence in the candidate target sentence set to generate the semantic relation value between the candidate target sentence and the input sentence.
Step two: and calculating a semantic relation value.
For the candidate target sentence and the input sentence, a character coincidence degree is calculated using the following formula:
where c _ o represents the character overlap ratio of Q and a, len () represents the calculate character number function, Q represents the input sentence, and a represents the candidate target sentence. Q.andgate.A represents the same character set in Q and A, len (Q.andgate.A) represents the number of characters in the same character set in Q and A, and Q.andgate.A represents the union of characters in Q and A. len (Q.u.A) represents the number of characters in the set of characters in Q and A.
For the candidate target sentence and the input sentence, an edit distance ratio is calculated using the following formula:
where edp represents the edit distance ratio of Q and a, and len () represents the calculate character number function. Q denotes an input sentence, and A denotes the candidate target sentence. len (Q U.A) represents the number of characters in the collection of characters in Q and A, and ed (Q, A) represents the number of characters required to be edited and modified to convert Q into A.
Converting the candidate target sentence into a first word vector, converting the input sentence into a second word vector, and calculating the difference degree by using the following formula:
where Sim represents the calculated degree of difference between Q and a, Q represents the input sentence, a represents the candidate target sentence, I represents the first word vector, and R represents the second word vector. I | represents the length of I and R | represents the length of R. CosDis (,) represents a function of the distance between the computing element and the cosine of the vectorAnd (4) counting. ω denotes the element, ω1Representing an element, ω, in a first word vector2Representing an element in the second word vector α represents a parameter, α is an arbitrary integer max () represents taking the maximum value, min () represents taking the minimum value CosDis (ω, R) represents ω2And the cosine distance between R, max (α× CosDis (ω)2R)) means to take α× CosDis (omega)2Maximum value of R), min (max (α× CosDis (ω)2R)),1) represents max (α× CosDis (ω)2R)) and 1.Represents the sum of all elements in I and the differences of R, CosDis (omega)1I) represents omega1And the cosine distance between I max (α× CosDis (ω)1I)) means α× CosDis (ω)1Min (max (α× CosDis (ω))1I)),1) represents taking max (α× CosDis (ω)1, I)) and the minimum of 1,represents the sum of differences of all elements in R and I.
And connecting the character overlap ratio, the editing distance ratio and the difference in series to generate a semantic relation value of the candidate target sentence and the input sentence. The specific semantic relationship value may be denoted as [ c _ o, edp, Sim ]. Where c _ o denotes a character coincidence degree, edp denotes an edit distance ratio, and Sim denotes a calculation difference degree.
And (5) for each candidate target statement in the candidate target statement set, after the second step is executed, generating a semantic relation value between the candidate target statement and the input statement to obtain a semantic relation value set of the input statement.
In some embodiments, the execution subject determines the semantic relationship value with the largest value according to the semantic relationship value set. And determining the candidate target sentences corresponding to the semantic relation values as target sentences of the input sentences.
Optionally, the execution body sends the target sentence to a device supporting display, and controls the device to display the target sentence. The display-supporting device may be a device communicatively connected to the execution main body, and may display the received target sentence. For example, when the input sentence for executing the subject question includes the target entity information "beijing", the target sentence is determined to be "beijing is the capital of china". The corresponding triple data "beijing, capital, china" may be sent to and displayed on a display-supporting device. The display information is sent out, so that the question answering system is prompted to input answers corresponding to the sentences, and the level of corresponding operation is improved.
One embodiment presented in fig. 2 has the following beneficial effects: and generating a candidate target sentence set of the question-answering system according to the target entity information and a pre-obtained knowledge graph. The candidate target sentences in the candidate target sentence set are candidate answer sentences of input sentences of the question-answering system, and the candidate target sentence set is determined according to the target entity information, so that the accuracy of problem judgment can be improved. And determining and outputting the target sentence of the input sentence according to the semantic relation value between the candidate target sentence and the input sentence, so that the performance of the sentence output task is improved, and the output sentence is more in line with the requirement of a question-answering system.
With further reference to fig. 3, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a sentence display apparatus for a question-and-answer system, which correspond to the embodiments of the artificial intelligence based sentence display method for a question-and-answer system shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 3, a sentence display apparatus 300 for a question-answering system of some embodiments includes: a receiving unit 301, a first generating unit 302, a second generating unit 303, a third generating unit 304, and a determining unit 305. Wherein the receiving unit 301 is configured to retrieve the input sentence. The first generating unit 302 is configured to determine target entity information based on the input sentence. Wherein the target entity information is a keyword in the input sentence. The second generating unit 303 is configured to generate a set of candidate target sentences based on the target entity information and the pre-derived knowledge-graph. The third generating unit 304 is configured to, for each candidate target sentence in the set of candidate target sentences, match the candidate target sentence with the input sentence, generate a semantic relation value between the candidate target sentence and the input sentence, and obtain a semantic relation value set of the input sentence. The determination unit 305 is configured to determine and output a target sentence of the input sentence based on the semantic relation value set.
Some embodiments of the present disclosure provide an apparatus that generates a set of candidate target sentences as a set of reference answer sentences for question sentences input by a question-answering system, according to input sentences received by a receiving unit. According to the semantic relation value set generated by the generating unit, the determining unit determines a target sentence corresponding to the input sentence, and the target sentence is used as an answer sentence of the question-answering system, so that the performance of a sentence output task is improved, and the output sentence is more in line with the requirement of the question-answering system.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use in implementing a server of an embodiment of the present disclosure is shown. The server shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM402, and RAM 403 are connected to each other via a bus 404. An Input/Output (I/O) interface 405 is also connected to the bus 404.
The following components are connected to the I/O interface 405: a storage section 406 including a hard disk and the like; and a communication section 407 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 407 performs communication processing via a network such as the internet. A drive 408 is also connected to the I/O interface 405 as needed. A removable medium 409 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted as necessary on the drive 408, so that a computer program read out therefrom is mounted as necessary in the storage section 406.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 407 and/or installed from the removable medium 409. The above-described functions defined in the method of the present disclosure are performed when the computer program is executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable medium in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the C language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Claims (9)
1. An artificial intelligence based sentence display method for a question-answering system, comprising:
acquiring an input statement;
determining target entity information based on the input sentence, wherein the target entity information is a keyword in the input sentence;
generating a candidate target statement set based on the target entity information and a pre-obtained knowledge graph;
for each candidate target statement in the candidate target statement set, matching the candidate target statement with the input statement, generating a semantic relation value between the candidate target statement and the input statement, and obtaining a semantic relation value set of the input statement;
and determining and outputting a target statement of the input statement based on the semantic relation value set.
2. The method of claim 1, wherein the method further comprises:
and sending the target sentence to a device supporting display, and controlling the device to display the target sentence.
3. The method of claim 2, wherein the target entity information refers to a character set contained in a node in a knowledge graph; and
the determining target entity information based on the input statement comprises:
performing word segmentation on the input sentence to obtain a word segmentation set included in the input sentence;
and generating the target entity information based on the word segmentation set.
4. The method of claim 3, wherein the generating the target entity information based on the set of participles comprises:
for each participle in the participle set, generating a word vector of the participle, and determining the word vector as a score of the target entity information of the input sentence to obtain a score set of the participle set;
and determining the participle in the participle set corresponding to the score with the largest value in the score set as the target entity information.
5. The method of claim 4, wherein the pre-derived knowledge-graph comprises nodes and edges, wherein the nodes comprise entity information and the edges represent relationships between different nodes; and
generating a candidate target statement set based on the target entity information and a pre-obtained knowledge graph, wherein the generating comprises:
finding a graph structure set corresponding to the target entity information in the pre-obtained knowledge graph;
for each graph structure in the graph structure set, extracting triple data of the graph structure to obtain a triple data set of the target entity information;
determining the triple data set as the candidate target statement set.
6. The method of claim 5, wherein matching, for each candidate target sentence in the set of candidate target sentences with the input sentence, the candidate target sentence to generate a semantic relationship value of the candidate target sentence with the input sentence, comprises:
for the candidate target sentence and the input sentence, a character coincidence degree is calculated using the following formula:where c _ o represents the degree of coincidence of characters of Q and a, len () represents the function of calculating the number of characters, Q represents the input sentence, a represents the candidate target sentence, Q ∩ a represents the same character set in Q and a, len (Q ∩ a) represents the number of characters in the same character set in Q and a, Q ∪ a represents the union of characters in Q and a, len (Q ∪ a) represents the number of characters in the union of characters in Q and a;
for the candidate target sentence and the input sentence, an edit distance ratio is calculated using the following formula:wherein edp represents the edit distance ratio of Q and A, len () represents the calculate number of characters function, Q represents the input sentence, A represents the candidate target sentence, len (Q ∪ A) represents the number of characters in the collection of characters in Q and A, ed (Q, A) represents the number of characters that need to be edited and modified to convert Q to A;
converting the candidate target sentence into a first word vector, converting the input sentence into a second word vector, and calculating the difference degree by using the following formula:
where Sim represents the calculated difference between Q and A, Q represents the input sentence, A represents the candidate target sentence, I represents the first word vector, R represents the second word vector, | I | represents the length of I, | R | represents the length of R, CosDis (,) represents the function of the computed element and the vector cosine distance, ω represents the element, ω is1Representing an element, ω, in a first word vector2Representing elements in the second word vector, α representing arguments, α being an arbitrary integer, max () representing the maximum value, min () representing the minimum value, CosDis (ω, R) representing ω2And the cosine distance between R, max (α× CosDis (ω)2R)) means to take α× CosDis (omega)2Maximum value of R), min (max (α× CosDis (ω)2R)),1) represents max (α× CosDis (ω)2R)) and 1,represents the sum of all elements in I and the differences of R, CosDis (omega)1I) represents omega1And the cosine distance between I, max (α× CosDis (ω)1I)) means α× CosDis (ω)1Maximum value of I), min (max (α× CosDis (ω)1I)),1) represents taking max (α× CosDis (ω)1, I)) and the minimum of 1,represents the sum of differences of all elements in R and I;
and generating a semantic relation value of the candidate target sentence and the input sentence based on the character coincidence degree, the editing distance ratio and the difference degree.
7. A sentence display apparatus for a question-answering system, comprising:
a receiving unit configured to acquire an input sentence;
a first generation unit configured to determine target entity information based on the input sentence, wherein the target entity information is a keyword in the input sentence;
a second generation unit configured to generate a candidate target sentence set based on the target entity information and a pre-obtained knowledge graph;
a third generating unit, configured to, for each candidate target sentence in the candidate target sentence set, match the candidate target sentence with the input sentence, generate a semantic relation value between the candidate target sentence and the input sentence, and obtain a semantic relation value set of the input sentence;
a determining unit configured to determine and output a target sentence of the input sentence based on the semantic relation value set.
8. A first terminal device comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
9. A computer-readable storage medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010580653.7A CN111723188A (en) | 2020-06-23 | 2020-06-23 | Sentence display method and electronic equipment based on artificial intelligence for question-answering system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010580653.7A CN111723188A (en) | 2020-06-23 | 2020-06-23 | Sentence display method and electronic equipment based on artificial intelligence for question-answering system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111723188A true CN111723188A (en) | 2020-09-29 |
Family
ID=72568448
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010580653.7A Withdrawn CN111723188A (en) | 2020-06-23 | 2020-06-23 | Sentence display method and electronic equipment based on artificial intelligence for question-answering system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111723188A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112232085A (en) * | 2020-10-15 | 2021-01-15 | 海南大学 | Cross-DIKW modal text ambiguity processing method oriented to essential computing and reasoning |
-
2020
- 2020-06-23 CN CN202010580653.7A patent/CN111723188A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112232085A (en) * | 2020-10-15 | 2021-01-15 | 海南大学 | Cross-DIKW modal text ambiguity processing method oriented to essential computing and reasoning |
CN112232085B (en) * | 2020-10-15 | 2021-10-08 | 海南大学 | Cross-DIKW modal text ambiguity processing method oriented to essential computing and reasoning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107679039B (en) | Method and device for determining statement intention | |
US11151177B2 (en) | Search method and apparatus based on artificial intelligence | |
US10528667B2 (en) | Artificial intelligence based method and apparatus for generating information | |
CN111444340B (en) | Text classification method, device, equipment and storage medium | |
CN107066449B (en) | Information pushing method and device | |
CN107273503B (en) | Method and device for generating parallel text in same language | |
US11620321B2 (en) | Artificial intelligence based method and apparatus for processing information | |
CN110046254B (en) | Method and apparatus for generating a model | |
CN107861954B (en) | Information output method and device based on artificial intelligence | |
CN111104482A (en) | Data processing method and device | |
CN111709240A (en) | Entity relationship extraction method, device, equipment and storage medium thereof | |
CN113360699B (en) | Model training method and device, and image question-answering method and device | |
CN108491387B (en) | Method and apparatus for outputting information | |
CN108121699B (en) | Method and apparatus for outputting information | |
CN113705733A (en) | Medical bill image processing method and device, electronic device and storage medium | |
CN112188311B (en) | Method and apparatus for determining video material of news | |
CN111738010A (en) | Method and apparatus for generating semantic matching model | |
CN113268560A (en) | Method and device for text matching | |
CN113836268A (en) | Document understanding method and device, electronic equipment and medium | |
CN112182255A (en) | Method and apparatus for storing media files and for retrieving media files | |
CN118193668A (en) | Text entity relation extraction method and device | |
CN110807097A (en) | Method and device for analyzing data | |
CN111723188A (en) | Sentence display method and electronic equipment based on artificial intelligence for question-answering system | |
CN113268575B (en) | Entity relationship identification method and device and readable medium | |
CN109857838B (en) | Method and apparatus for generating information |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200929 |
|
WW01 | Invention patent application withdrawn after publication |