CN109656385B - Input prediction method and device based on knowledge graph and electronic equipment - Google Patents

Input prediction method and device based on knowledge graph and electronic equipment Download PDF

Info

Publication number
CN109656385B
CN109656385B CN201811621360.8A CN201811621360A CN109656385B CN 109656385 B CN109656385 B CN 109656385B CN 201811621360 A CN201811621360 A CN 201811621360A CN 109656385 B CN109656385 B CN 109656385B
Authority
CN
China
Prior art keywords
keyword
preset
knowledge
relation chain
text
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.)
Active
Application number
CN201811621360.8A
Other languages
Chinese (zh)
Other versions
CN109656385A (en
Inventor
王培娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201811621360.8A priority Critical patent/CN109656385B/en
Publication of CN109656385A publication Critical patent/CN109656385A/en
Application granted granted Critical
Publication of CN109656385B publication Critical patent/CN109656385B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/02Input arrangements using manually operated switches, e.g. using keyboards or dials
    • G06F3/023Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
    • G06F3/0233Character input methods
    • G06F3/0237Character input methods using prediction or retrieval techniques
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application provides an input prediction method and device based on a knowledge graph and electronic equipment, wherein the method comprises the following steps: acquiring a text in an input box before an input cursor and acquiring a current pinyin character string; performing word segmentation on the text, acquiring a plurality of word segments in the text, and performing Chinese character coding on the current pinyin character string; detecting whether the multiple participles comprise a first keyword or not, detecting whether a relation chain is included after the Chinese character is coded or not, and if the relation chain comprises the first keyword, querying a preset knowledge map database to obtain a second keyword corresponding to the first keyword and the relation chain; and displaying the Chinese character codes and the second key words corresponding to the relation chains in the cloud prediction column. Therefore, semantic analysis and understanding are carried out on the input text of the user, association of words is carried out through the knowledge map database, reasonable input recommendation can be given quickly, and the communication efficiency of the user is improved.

Description

Input prediction method and device based on knowledge graph and electronic equipment
Technical Field
The present application relates to the field of intelligent input technologies, and in particular, to an input prediction method and apparatus based on a knowledge graph, and an electronic device.
Background
Currently, the main function of the input method is to provide a keyboard for the user to complete the input by typing. However, the input requirement is a communication requirement, and if the input method can predict what the user wants to input in the current scene and how to complete input and send quickly, the most fundamental input requirement of the user is solved.
In the related technology, the prediction of the input method is based on data statistics, and high-frequency vocabulary entry collocation combination, namely binary or ternary data results are counted on the corpus, for example, if left elements hit, the right elements of the high frequency are given as prediction vocabulary entries for users to select.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, the input prediction method based on the knowledge graph is provided, semantic analysis and understanding are carried out on input texts of users, association of words is carried out through a knowledge graph database, reasonable input recommendation can be given quickly, and communication efficiency of the users is improved greatly.
The application provides an input prediction device based on a knowledge graph.
The application provides an electronic device.
The present application provides a computer-readable storage medium.
The embodiment of the first aspect of the application provides a knowledge graph-based input prediction method, which comprises the following steps:
acquiring a text in an input box before an input cursor and acquiring a current pinyin character string;
performing word segmentation on the text, acquiring a plurality of word segments in the text, and performing Chinese character coding on the current pinyin character string;
detecting whether the plurality of participles comprise a first keyword or not, and detecting whether a relation chain is included after the Chinese character is coded or not,
if the keyword and the relation chain are known, querying a preset knowledge graph database to obtain a second keyword corresponding to the first keyword and the relation chain;
and displaying the Chinese character codes corresponding to the relation chain and the second key words on a cloud prediction column.
Optionally, as a first possible implementation manner of the first aspect of the present application, before querying a preset knowledge graph database to obtain a second keyword corresponding to the first keyword and the relationship chain, the method further includes:
acquiring a plurality of knowledge entries;
identifying the plurality of knowledge entries to obtain keywords and a relation chain in each knowledge entry;
and storing the plurality of keywords and the plurality of relationship chains according to a preset mode to generate a preset knowledge map database.
Optionally, as a second possible implementation manner of the first aspect of the present application, the detecting whether the multiple segmented words include the first keyword includes:
recognizing the multiple word segments through a preset entity recognition algorithm to obtain multiple corresponding entities;
and if the entities are matched with a first keyword in a preset relation chain word bank, determining that the participles comprise the first keyword.
Optionally, as a third possible implementation manner of the first aspect of the present application, the relationship chain includes: a first relationship chain and a second relationship chain;
the querying a preset knowledge map database to obtain a second keyword corresponding to the first keyword and the relation chain comprises the following steps:
acquiring a corresponding third key word in a preset knowledge graph database according to the first key word and the first relation chain;
and acquiring a corresponding second keyword in a preset knowledge graph database according to the third keyword and the second relation chain.
Optionally, as a fourth possible implementation manner of the first aspect of the present application, after querying a preset knowledge graph database to obtain a second keyword corresponding to the first keyword and the relationship chain, the method further includes:
matching a fourth keyword in a preset hot word library according to the first keyword and the second keyword;
and displaying the fourth keyword at a second preset position of the prediction bar.
In a second aspect, an embodiment of the present application provides a knowledge-graph-based input prediction apparatus, including:
the acquisition module is used for acquiring a text in the input box before an input cursor and acquiring a current pinyin character string;
the obtaining and coding module is used for cutting words of the text, obtaining a plurality of participles in the text and coding the Chinese characters of the current pinyin character string;
the detection module is used for detecting whether the multiple participles comprise a first keyword or not and detecting whether a relation chain is included after the Chinese character is coded or not;
the query acquisition module is used for querying a preset knowledge map database to acquire second keywords corresponding to the first keywords and the relation chain if the first keywords and the relation chain are acquired;
and the display module is used for displaying the Chinese character codes corresponding to the relationship chain and the second key words in the cloud prediction column.
Optionally, as a first possible implementation manner of the second aspect of the present application, the apparatus further includes:
the first acquisition module is used for acquiring a plurality of knowledge entries;
the second acquisition module is used for identifying the plurality of knowledge entries and acquiring keywords and relationship chains in each knowledge entry;
and the generating module is used for storing the plurality of keywords and the plurality of relationship chains according to a preset mode to generate a preset knowledge map database.
Optionally, as a second possible implementation manner of the second aspect of the present application, the detection module is specifically configured to:
recognizing the multiple word segments through a preset entity recognition algorithm to obtain multiple corresponding entities;
and if the entities are matched with a first keyword in a preset relation chain word bank, determining that the participles comprise the first keyword.
Optionally, as a third possible implementation manner of the second aspect of the present application, the relationship chain includes: a first relationship chain and a second relationship chain;
the query obtaining module is specifically configured to:
acquiring a corresponding third key word in a preset knowledge graph database according to the first key word and the first relation chain;
and acquiring a corresponding second keyword in a preset knowledge graph database according to the third keyword and the second relation chain.
Optionally, as a fourth possible implementation manner of the second aspect of the present application, the apparatus further includes:
the matching module is used for matching a fourth keyword in a preset hot-spot word library according to the first keyword and the second keyword;
the display module is further used for displaying the fourth keyword at a second preset position of the prediction bar.
An embodiment of a third aspect of the present application provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of knowledge-graph based input prediction of the first aspect when executing the program.
An embodiment of a fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for predicting knowledge-graph-based input according to the first aspect.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the method comprises the steps of obtaining a text in an input box before an input cursor, obtaining a current pinyin character string, cutting words of the text, obtaining a plurality of participles in the text, obtaining the current pinyin character string, carrying out Chinese character coding on the current pinyin character string, detecting whether the participles comprise a first keyword or not, detecting whether a relation chain or not is included after Chinese character coding or not, inquiring a preset knowledge graph database to obtain a second keyword corresponding to the first keyword and the relation chain if the relation chain and the first keyword are included, and finally displaying the Chinese character coding and the second keyword corresponding to the relation chain in a cloud prediction column. Therefore, semantic analysis and understanding are carried out on the input text of the user, association of words is carried out through the knowledge graph database, reasonable input recommendation can be given quickly, and communication efficiency of the user is improved greatly.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart of a method for input prediction based on knowledge-graph according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating a preset poetry corpus generation process according to an embodiment of the present disclosure;
FIG. 3 is a schematic illustration of a knowledge-graph based input prediction provided by an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an input prediction apparatus based on a knowledge-graph according to an embodiment of the present application;
FIG. 5 is a schematic diagram of another knowledge-graph based input prediction apparatus provided in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of another input prediction apparatus based on a knowledge-graph according to an embodiment of the present application; and
fig. 7 is a schematic structural diagram of an embodiment of an electronic device according to the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative and intended to explain the present application and should not be construed as limiting the present application.
The knowledge-graph-based input prediction method, apparatus, and electronic device according to embodiments of the present application are described below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of an input prediction method based on a knowledge graph according to an embodiment of the present disclosure.
As shown in fig. 1, the method comprises the steps of:
step 101, acquiring a text in an input box before an input cursor, and acquiring a current pinyin character string.
And 102, segmenting the text, acquiring a plurality of segmented words in the text, and coding the current pinyin character string by Chinese characters.
In practical applications, the user may input text at a location such as a dialog input box of the instant messaging application or a search input box of the search application, as desired.
Alternatively, the text before the user enters the cursor in the input box is obtained, it being understood that the text may be a word, or a sentence, or a paragraph, etc.
Therefore, the word segmentation is performed on the text through the word segmentation model or the word segmentation algorithm to obtain a plurality of word segments corresponding to the text, for example, the text is 'small and clear', and the word segmentation is performed on the text to obtain 'small and clear'.
Alternatively, the pinyin character string input by the user is obtained, and it is understood that the pinyin character string may be a pinyin character string of a word, or a pinyin character string of a sentence, or a pinyin character string of a paragraph, and so on.
Optionally, chinese character encoding is performed on the current pinyin character string in the current input interface to obtain chinese characters, i.e., text information, corresponding to the current pinyin character string.
Step 103, detecting whether the multiple participles include a first keyword or not, detecting whether the multiple participles include a relation chain or not after the Chinese character is coded, and if the multiple participles include the first keyword and the relation chain, querying a preset knowledge map database to obtain a second keyword corresponding to the first keyword and the relation chain.
And 104, displaying the Chinese character codes and the second key words corresponding to the relation chains in a cloud prediction column.
Optionally, after obtaining the multiple segmented words, it may be detected whether the multiple segmented words include the first keyword, for example, as follows:
in a first example, the first keyword is included in a predetermined knowledge graph database by querying.
In a second example, a plurality of participles are identified through a preset entity identification algorithm, a plurality of corresponding entities are obtained, and if the plurality of entities match a first keyword in a preset relation chain word bank, the plurality of participles are determined to include the first keyword. For example, the text is 'Xiaoming', the text is cut into words to obtain 'Xiaoming' and 'Xiaoming', the multiple word segments are identified through a preset entity identification algorithm to obtain an entity 'Xiaoming', and then the first keyword 'Xiaoming' is matched in a preset relational chain word library.
That is, the query can be directly performed through a preset knowledge map database, and the query can also be performed through setting a relation database.
Similarly, after the Chinese character corresponding to the current pinyin character string is obtained by performing Chinese character coding on the current pinyin character string in the current input interface, whether the preset knowledge map database comprises the relation chain or not can be directly inquired through the preset knowledge map database, or the Chinese character corresponding to the current pinyin character string is identified, a plurality of corresponding entities are obtained, and the relation chain is matched in the preset relation chain lexicon by the plurality of entities.
In the embodiment of the application, the knowledge graph is based on knowledge, all knowledge of the internet is accumulated, the real world is really understood, and the information collection is improved to be accumulated as the knowledge, so that the world is understood by the knowledge.
Optionally, before querying a preset knowledge graph database to obtain a second keyword corresponding to the first keyword and the relationship chain, a preset knowledge graph database needs to be generated, as shown in fig. 2 specifically:
step 201, acquiring a plurality of knowledge entries.
Step 202, identifying a plurality of knowledge entries, and acquiring keywords and relationship chains in each knowledge entry.
And 203, storing the plurality of keywords and the plurality of relationship chains according to a preset mode to generate a preset knowledge map database.
Specifically, all knowledge entries of the internet are collected, keywords and relationship chains in each knowledge entry are identified, the keywords and the relationship chains are stored according to a preset mode to generate a preset knowledge map database, for example, the keyword "xiaming" and the "xiahong" are identified to obtain the keywords "xiaming" and the "xiahong" and the relationship chain "wife", and therefore the "xiaming", "wife" and the "xiahong" are stored in a mapping table mode to generate the preset knowledge map database.
Therefore, a preset knowledge graph database can be queried to obtain a second keyword corresponding to the first keyword and the relation chain, and the Chinese character code and the second keyword corresponding to the relation chain are displayed in the cloud prediction column.
For example, as shown in fig. 3, a text in front of an input cursor in an input box is obtained as "xiaoming", a plurality of participles in the text are obtained as "xiaoming" and "laopo", a current pinyin character string "laopo" is obtained, and the "laopo" is subjected to chinese character coding to obtain a corresponding chinese character "wife", the "wife" is detected to include a first keyword "xiaoming" and the "wife" is detected to include a relation chain "wife", a preset knowledge graph database is queried to obtain a second keyword "xiahong" corresponding to the "wife" and the "wife", and the "wife" and the "wihong" are displayed in a cloud prediction column.
In the input prediction method based on the knowledge graph, a text in front of an input cursor in an input box is obtained, a current pinyin character string is obtained, the text is subjected to word segmentation, a plurality of participles in the text are obtained, the current pinyin character string is obtained, chinese character coding is carried out on the current pinyin character string, whether the participles comprise a first keyword or not is detected, whether a relation chain is included after the Chinese character coding or not is detected, if the relation chain comprises the first keyword, a preset knowledge graph database is inquired, a second keyword corresponding to the first keyword and the relation chain is obtained, and finally the Chinese character coding and the second keyword corresponding to the relation chain are displayed in a cloud prediction column. Therefore, semantic analysis and understanding are carried out on the input text of the user, association of words is carried out through the knowledge map database, reasonable input recommendation can be given quickly, and the communication efficiency of the user is greatly improved.
Based on the foregoing embodiments, it can also be understood that, in a case where there are a plurality of relation chains in the plurality of word segments, as one possible implementation manner, the relation chains include: and the first relation chain and the second relation chain acquire corresponding third key words in a preset knowledge graph database according to the first key words and the first relation chain, and acquire corresponding second key words in the preset knowledge graph database according to the third key words and the second relation chain.
For example, a text before an input cursor in an input box is acquired as a "Xiaoming mother of Ladies", a plurality of participles in the text are acquired as "Xiaoming", "and a current pinyin character string" laopodemama ", chinese character coding is performed on the" laopodemama "to obtain a corresponding Chinese character" Lapo mother ", the" Xiaoming "," mother "including a first keyword" Xiaoming "and a Chinese character" Lapo "including a relationship chain" Lapo "and" mother "is detected, a preset knowledge graph database is queried to obtain a third relationship word" Xiaohong "corresponding to the" Xiaoming "and the" Lapo ", then a second keyword" Xiaohong "corresponding to the" Xiaohong "and the" mother "is acquired, and the" Lapo mother Xiaoli "is displayed in a cloud prediction column. Semantic analysis and understanding are further performed, reasonable input recommendation is rapidly given, the flexibility of input recommendation is improved, and the communication efficiency of users is greatly improved.
Based on the above embodiment, it can be further understood that after the preset knowledge graph database is queried to obtain the second keyword corresponding to the first keyword and the relationship chain, the fourth keyword may be matched in the preset hotspot dictionary database according to the first keyword and the second keyword, and the fourth keyword is displayed at the second preset position of the prediction bar. The hot word bank is a word which is obtained in advance and has the click rate or the search rate larger than a preset threshold value in the network, and hot words are sorted according to the click rate or the search rate. And determining the first hot words in the hot words matched according to the first key words and the second key words as fourth key words, or determining N hot words in the top sequence as the fourth key words.
For example, the method includes the steps of obtaining that a text in an input box before an input cursor is 'xiaoming', obtaining that a plurality of participles in the text are 'xiaoming' and obtaining a current pinyin character string 'laopo', carrying out Chinese character coding on the 'laopo' to obtain a corresponding Chinese character 'wife', detecting that the 'xiaoming' and the 'wife' comprise a first keyword 'xiaoming' and a first keyword 'wife' and a relation chain 'wife', querying a preset knowledge graph database to obtain a second keyword 'xiaohong' corresponding to the 'xiaoming' and the 'wife', matching the 'xiaoming' and the 'wife' in a preset hot word library to a fourth keyword 'xiaohong', and displaying the 'xiaohong' at a second preset position of a prediction column, such as a second selected position of the prediction column, so as to further meet input requirements of a user.
In order to implement the above embodiments, the present application further provides a knowledge-graph-based input prediction apparatus.
Fig. 4 is a schematic structural diagram of an input prediction apparatus based on a knowledge graph according to an embodiment of the present application.
As shown in fig. 4, the apparatus includes: an acquisition module 41, an acquisition encoding module 42, a detection module 43, a query acquisition module 44, and a presentation module 45.
The obtaining module 41 is configured to obtain a text in the input box before the input cursor and obtain a current pinyin character string.
And the obtaining and coding module 42 is used for performing word segmentation on the text, obtaining a plurality of word segments in the text, and performing Chinese character coding on the current pinyin character string.
The detecting module 43 is configured to detect whether the multiple segmented words include the first keyword, and detect whether the relation chain is included after the chinese character is encoded.
And the query obtaining module 44 is configured to, if the first keyword and the relationship chain are known, query a preset knowledge graph database to obtain a second keyword corresponding to the first keyword and the relationship chain.
And the display module 45 is used for displaying the Chinese character codes and the second keywords corresponding to the relationship chains in the cloud prediction column.
Based on the foregoing embodiments, the present application further provides a possible implementation manner of a knowledge-graph-based input prediction apparatus, fig. 5 is a schematic structural diagram of another knowledge-graph-based input prediction apparatus provided in the present application, and on the basis of fig. 4, the apparatus further includes: a first acquisition module 46, a second acquisition module 47, and a generation module 48.
The first obtaining module 46 is configured to obtain a plurality of knowledge entries.
And the second obtaining module 47 is configured to identify the multiple knowledge entries, and obtain the keywords and the relationship chain in each knowledge entry.
And a generating module 48, configured to store the multiple keywords and the multiple relationship chains according to a preset manner to generate a preset knowledge graph database.
Based on the foregoing embodiment, the present application further provides a possible implementation manner of the input prediction apparatus based on the knowledge graph, and the detection module 43 is specifically configured to: recognizing the multiple word segments through a preset entity recognition algorithm to obtain a plurality of corresponding entities; and if the plurality of entities are matched with the first keyword in a preset relation chain word bank, determining that the plurality of participles comprise the first keyword.
Based on the foregoing embodiments, the present application further provides a possible implementation manner of the input prediction apparatus based on the knowledge graph, where the relationship chain includes: a first relationship chain and a second relationship chain; the query obtaining module 44 is specifically configured to: acquiring a corresponding third key word in a preset knowledge graph database according to the first key word and the first relation chain; and acquiring a corresponding second keyword in a preset knowledge graph database according to the third keyword and the second relation chain.
The embodiment of the present application further provides a possible implementation manner of a knowledge-graph-based input prediction apparatus, fig. 6 is a schematic structural diagram of another knowledge-graph-based input prediction apparatus provided in the embodiment of the present application, and on the basis of fig. 4, the apparatus further includes: a matching module 49.
And the matching module 49 is configured to match a fourth keyword in a preset hot-spot thesaurus according to the first keyword and the second keyword.
The displaying module 45 is further configured to display the fourth keyword at a second preset position of the prediction bar.
It should be noted that the foregoing explanation of the method embodiment is also applicable to the apparatus of the embodiment, and is not repeated herein.
In the input prediction device based on the knowledge graph, a text in front of an input cursor in an input box is obtained, and a current pinyin character string is obtained; the method comprises the steps of cutting words of a text, obtaining a plurality of word segments in the text, obtaining a current pinyin character string, carrying out Chinese character coding on the current pinyin character string, detecting whether the word segments comprise first keywords or not, detecting whether a relation chain is included after Chinese character coding or not, inquiring a preset knowledge graph database to obtain second keywords corresponding to the first keywords and the relation chain if the relation chain is included, and finally displaying the Chinese character codes and the second keywords corresponding to the relation chain in a cloud prediction column. Therefore, semantic analysis and understanding are carried out on the input text of the user, association of words is carried out through the knowledge map database, reasonable input recommendation can be given quickly, and the communication efficiency of the user is greatly improved.
In order to implement the above embodiments, the present application also provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the program when executed by the processor implementing the method for knowledge-graph based input prediction as described in the method embodiments above.
An embodiment of the present application further provides an electronic device, which includes the apparatus according to any of the foregoing embodiments.
Fig. 7 is a schematic structural diagram of an embodiment of an electronic device of the present application, which may implement a flow of the method embodiment shown in fig. 1-2 of the present application, and as shown in fig. 7, the electronic device may include: a housing 91, a processor 92, a memory 93, a circuit board 94 and a power circuit 95, wherein the circuit board 94 is disposed inside a space enclosed by the housing 91, and the processor 92 and the memory 93 are disposed on the circuit board 94; a power supply circuit 95 for supplying power to each circuit or device of the electronic apparatus; the memory 93 is used to store executable program code; the processor 92 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 93, for executing the video generation method described in any one of the foregoing embodiments.
For a specific execution process of the above steps by the processor 92 and further steps executed by the processor 92 by running the executable program code, reference may be made to the description of the method embodiment shown in fig. 1-2 in this application, which is not described herein again.
The electronic device exists in a variety of forms, including but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices can display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because of the need of providing high-reliability service.
(5) And other electronic equipment with data interaction function.
In order to implement the above embodiments, the present application further proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method for knowledge-graph based input prediction as described in the aforementioned method embodiments.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or to implicitly indicate the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (8)

1. A knowledge graph-based input prediction method is characterized by comprising the following steps:
acquiring a text in an input box before an input cursor and acquiring a current pinyin character string;
performing word segmentation on the text, acquiring a plurality of word segments in the text, and performing Chinese character coding on the current pinyin character string;
detecting whether the multiple participles comprise a first keyword or not, and detecting whether a relation chain is included after the Chinese character is coded or not, wherein the relation chain comprises a first relation chain and a second relation chain;
if the keyword and the relation chain are acquired, querying a preset knowledge graph database to acquire a second keyword corresponding to the first keyword and the relation chain, wherein a corresponding third keyword is acquired in the preset knowledge graph database according to the first keyword and the first relation chain, and a corresponding second keyword is acquired in the preset knowledge graph database according to the third keyword and the second relation chain;
displaying the Chinese character codes corresponding to the relation chain and the second key words in a cloud prediction column;
the detecting whether the plurality of segmented words include a first keyword includes:
recognizing the multiple word segments through a preset entity recognition algorithm to obtain multiple corresponding entities;
and if the entities are matched with a first keyword in a preset relation chain word bank, determining that the participles comprise the first keyword.
2. The method of claim 1, further comprising, prior to querying a pre-provisioned knowledge-graph database for second keywords corresponding to the first keyword and the relationship chain:
acquiring a plurality of knowledge entries;
identifying the plurality of knowledge entries to obtain keywords and a relationship chain in each knowledge entry;
and storing the plurality of keywords and the plurality of relationship chains according to a preset mode to form a preset knowledge map database.
3. The method of claim 1, wherein after querying the pre-provisioned knowledge-graph database for second keywords corresponding to the first keywords and the relationship chain, further comprising:
matching a fourth keyword in a preset hot word bank according to the first keyword and the second keyword;
and displaying the fourth keyword at a second preset position of the prediction bar.
4. A knowledge-graph-based input prediction apparatus, the apparatus comprising:
the acquisition module is used for acquiring a text in the input box before an input cursor and acquiring a current pinyin character string;
the obtaining and coding module is used for cutting words of the text, obtaining a plurality of participles in the text and coding the Chinese characters of the current pinyin character string;
the detection module is used for detecting whether the multiple participles comprise a first keyword or not and detecting whether a relation chain is included after the Chinese character is coded or not, wherein the relation chain comprises a first relation chain and a second relation chain;
the query acquisition module is used for querying a preset knowledge graph database to acquire a second keyword corresponding to the first keyword and the relation chain if the first keyword and the relation chain are acquired, wherein a corresponding third keyword is acquired in the preset knowledge graph database according to the first keyword and the first relation chain, and a corresponding second keyword is acquired in the preset knowledge graph database according to the third keyword and the second relation chain;
the display module is used for displaying the Chinese character codes corresponding to the relationship chains and the second key words in a cloud prediction column;
the detection module is specifically configured to:
recognizing the multiple word segments through a preset entity recognition algorithm to obtain multiple corresponding entities;
and if the entities are matched with a first keyword in a preset relation chain word bank, determining that the participles comprise the first keyword.
5. The apparatus of claim 4, further comprising:
the first acquisition module is used for acquiring a plurality of knowledge entries;
the second acquisition module is used for identifying the plurality of knowledge entries and acquiring keywords and relationship chains in each knowledge entry;
and the generating module is used for storing the plurality of keywords and the plurality of relationship chains according to a preset mode to generate a preset knowledge map database.
6. The apparatus of claim 4, further comprising:
the matching module is used for matching a fourth keyword in a preset hot word bank according to the first keyword and the second keyword;
the display module is further used for displaying the fourth keyword at a second preset position of the cloud prediction bar.
7. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the program implementing the method of knowledge-graph based input prediction according to any of claims 1-3.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method for knowledge-graph based input prediction according to any one of claims 1-3.
CN201811621360.8A 2018-12-28 2018-12-28 Input prediction method and device based on knowledge graph and electronic equipment Active CN109656385B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811621360.8A CN109656385B (en) 2018-12-28 2018-12-28 Input prediction method and device based on knowledge graph and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811621360.8A CN109656385B (en) 2018-12-28 2018-12-28 Input prediction method and device based on knowledge graph and electronic equipment

Publications (2)

Publication Number Publication Date
CN109656385A CN109656385A (en) 2019-04-19
CN109656385B true CN109656385B (en) 2022-12-09

Family

ID=66117831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811621360.8A Active CN109656385B (en) 2018-12-28 2018-12-28 Input prediction method and device based on knowledge graph and electronic equipment

Country Status (1)

Country Link
CN (1) CN109656385B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096599B (en) * 2019-04-30 2023-03-21 长沙知了信息科技有限公司 Knowledge graph generation method and device
CN110941694A (en) * 2019-10-14 2020-03-31 珠海格力电器股份有限公司 Knowledge graph searching and positioning method and system, electronic equipment and storage medium
CN111353047A (en) * 2019-12-30 2020-06-30 常熟鑫沐奇宝软件开发有限公司 Method for generating artificial intelligence knowledge map based on Chinese character making method
CN112507129B (en) * 2020-12-07 2023-09-08 云南电网有限责任公司普洱供电局 Content change processing method of power distribution network operation file and related equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01260538A (en) * 1988-04-11 1989-10-17 Nippon Telegr & Teleph Corp <Ntt> Device for generating experiental knowledge in knowledge base system
CN107358315A (en) * 2017-06-26 2017-11-17 深圳市金立通信设备有限公司 A kind of information forecasting method and terminal
CN107704634A (en) * 2017-11-04 2018-02-16 辽宁工程技术大学 A kind of method for forming knowledge and building knowledge chain
CN107765883A (en) * 2016-08-22 2018-03-06 富士通株式会社 The sort method and sequencing equipment of candidate's word of input method
CN107908671A (en) * 2017-10-25 2018-04-13 南京擎盾信息科技有限公司 Knowledge mapping construction method and system based on law data
CN108121455A (en) * 2016-11-29 2018-06-05 渡鸦科技(北京)有限责任公司 Identify method and device for correcting

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1328653C (en) * 2004-03-19 2007-07-25 郦东 Method and system of hand writing input on portable terminal
CN104142938A (en) * 2013-05-07 2014-11-12 腾讯科技(深圳)有限公司 Data processing method, device and system of micro-blog
CN106293114B (en) * 2015-06-02 2019-03-29 阿里巴巴集团控股有限公司 Predict the method and device of user's word to be entered
CN106527757A (en) * 2016-10-28 2017-03-22 上海智臻智能网络科技股份有限公司 Input error correction method and apparatus
CN106896935A (en) * 2017-02-22 2017-06-27 李晓明 Input method
CN106873801A (en) * 2017-02-28 2017-06-20 百度在线网络技术(北京)有限公司 Method and apparatus for generating the combination of the entry in input method dictionary
CN107169010A (en) * 2017-03-31 2017-09-15 北京奇艺世纪科技有限公司 A kind of determination method and device of recommendation search keyword
CN109086408B (en) * 2018-08-02 2022-10-28 腾讯科技(深圳)有限公司 Text generation method and device, electronic equipment and computer readable medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01260538A (en) * 1988-04-11 1989-10-17 Nippon Telegr & Teleph Corp <Ntt> Device for generating experiental knowledge in knowledge base system
CN107765883A (en) * 2016-08-22 2018-03-06 富士通株式会社 The sort method and sequencing equipment of candidate's word of input method
CN108121455A (en) * 2016-11-29 2018-06-05 渡鸦科技(北京)有限责任公司 Identify method and device for correcting
CN107358315A (en) * 2017-06-26 2017-11-17 深圳市金立通信设备有限公司 A kind of information forecasting method and terminal
CN107908671A (en) * 2017-10-25 2018-04-13 南京擎盾信息科技有限公司 Knowledge mapping construction method and system based on law data
CN107704634A (en) * 2017-11-04 2018-02-16 辽宁工程技术大学 A kind of method for forming knowledge and building knowledge chain

Also Published As

Publication number Publication date
CN109656385A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN109508391B (en) Input prediction method and device based on knowledge graph and electronic equipment
CN109656385B (en) Input prediction method and device based on knowledge graph and electronic equipment
CN109657213B (en) Text similarity detection method and device and electronic equipment
CN108491433B (en) Chat response method, electronic device and storage medium
US11216504B2 (en) Document recommendation method and device based on semantic tag
CN107767870B (en) Punctuation mark adding method and device and computer equipment
EP3648099B1 (en) Voice recognition method, device, apparatus, and storage medium
CN106649818B (en) Application search intention identification method and device, application search method and server
CN108549656B (en) Statement analysis method and device, computer equipment and readable medium
CN109275047B (en) Video information processing method and device, electronic equipment and storage medium
CN111382260A (en) Method, device and storage medium for correcting retrieved text
CN108920649B (en) Information recommendation method, device, equipment and medium
CN111737966B (en) Document repetition detection method, device, equipment and readable storage medium
CN110704608A (en) Text theme generation method and device and computer equipment
CN110245357B (en) Main entity identification method and device
CN109508390B (en) Input prediction method and device based on knowledge graph and electronic equipment
CN111222328B (en) Label extraction method and device and electronic equipment
CN114461783A (en) Keyword generation method and device, computer equipment, storage medium and product
CN112925912A (en) Text processing method, and synonymous text recall method and device
CN111339778A (en) Text processing method, device, storage medium and processor
US20220335070A1 (en) Method and apparatus for querying writing material, and storage medium
CN116628278A (en) Multi-modal searching method, device, storage medium and equipment
CN110674286A (en) Text abstract extraction method and device and storage equipment
CN113553410B (en) Long document processing method, processing device, electronic equipment and storage medium
CN106570116B (en) Search result aggregation method and device based on artificial intelligence

Legal Events

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