WO2015127747A1 - 一种添加多媒体文件的方法和设备 - Google Patents

一种添加多媒体文件的方法和设备 Download PDF

Info

Publication number
WO2015127747A1
WO2015127747A1 PCT/CN2014/082691 CN2014082691W WO2015127747A1 WO 2015127747 A1 WO2015127747 A1 WO 2015127747A1 CN 2014082691 W CN2014082691 W CN 2014082691W WO 2015127747 A1 WO2015127747 A1 WO 2015127747A1
Authority
WO
WIPO (PCT)
Prior art keywords
multimedia
confidence
multimedia file
hit
keyword group
Prior art date
Application number
PCT/CN2014/082691
Other languages
English (en)
French (fr)
Inventor
王睿
关国锋
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015127747A1 publication Critical patent/WO2015127747A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/43Querying

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for adding a multimedia file.
  • the information carrier that communicates between people contains more and more multimedia (such as pictures, audio, video, etc.) data.
  • multimedia data such as pictures, audio, video, etc.
  • a text editing process such as Weibo, SMS, WORD document, email, etc.
  • the inventor finds that the current method of inserting multimedia data inevitably requires the user to search for a target data to be inserted in a large multimedia library. This method is cumbersome and the accuracy of the search is not high. And time consuming.
  • the embodiment of the invention provides a method and a device for adding a multimedia file, which are used for retrieving multimedia from a large amount of multimedia data and adding, saving search time and improving search accuracy.
  • the first aspect of the present invention provides a method for adding a multimedia file, which may include: acquiring character text;
  • the multimedia file whose confidence level satisfies the preset condition is added to the text.
  • the parsing the character text to obtain a search keyword group includes: Lexical analysis of the character text;
  • the lexical parsing of the character text includes:
  • the words with multiple synonymous expressions obtained after the named entity recognition are normalized into the standard words of the synonym group, and the standard words are the results obtained by the lexical analysis.
  • the syntactic parsing of the result of the lexical parsing includes:
  • the output result of the part-of-speech tag is analyzed, and the main-slave and modified relationship between the words and phrases in the output result is obtained, and a corresponding parse tree is generated.
  • the result of the syntactic parsing is semantically parsed
  • the search keyword group is output, including: combining preset knowledge a library, analyzing syntactically parsed words, mutual master-slave and modification relationships between phrases, identifying semantics and intentions of character texts, and generating a search keyword group, wherein the search keyword group includes a primary attribute keyword group and a slave An attribute keyword group for modifying an attribute of an object represented by the primary attribute keyword group.
  • the calculating the confidence of the multimedia file in the multimedia list includes:
  • the w primary is a weight value of the primary attribute keyword group
  • the w se ⁇ ndary is a weight value of the secondary attribute keyword group
  • the hit_ratio primary is a hit rate of the primary attribute keyword group
  • the hit_ratio se ⁇ ndary is a hit ratio of the dependent keyword group
  • the hit rate is a ratio of the number of hits to the total number of keywords in the search keyword group.
  • the determining, if the confidence level of the multimedia file in the multimedia list meets a preset condition, Add a multimedia file with a confidence level that meets the preset conditions to the text including:
  • the maximum confidence of the multimedia file is determined to meet the preset condition, the multimedia file with the highest confidence of the multimedia file is obtained in the multimedia list, and the multimedia file with the highest confidence of the multimedia file is added to the text.
  • the method further includes:
  • the method includes: determining the The confidence level of the multimedia file and the preset confidable threshold;
  • the multimedia file is deleted from the multimedia list in which it is located.
  • the method includes: following the multimedia file The confidence level is high to low, sorting the multimedia files in the multimedia list.
  • a second aspect of the present invention provides an apparatus for adding a multimedia file, which may include:
  • An acquisition module configured to obtain character text
  • a parsing module configured to parse the character text to obtain a search keyword group
  • a search module configured to retrieve and describe the preset multimedia library according to the search keyword group Retrieving a multimedia list that matches the keyword group
  • a calculation module configured to calculate a confidence level of the multimedia file in the multimedia list
  • the parsing module includes:
  • a first parsing unit configured to perform lexical parsing on the character text
  • a second parsing unit that parses the result of the lexical parsing
  • the third analysis unit performs semantic analysis on the result of the syntax analysis and outputs a search keyword group.
  • the first parsing unit is specifically configured to: perform word segmentation on the character text; and name the words, phrases, and phrases obtained after the word segmentation Entity recognition; according to the preset synonym list, the words having multiple synonymous expressions obtained after the named entity recognition are normalized into the standard words of the synonym group; the standard words are the results obtained by the lexical analysis.
  • the second parsing unit is specifically configured to: perform a part-of-speech tagging on the result of the lexical parsing; The output results are analyzed, and the words in the output result, the master-slave relationship between the phrases, and the modified relationship are obtained, and a corresponding parse tree is generated.
  • the third parsing unit is specifically configured to: combine the preset knowledge base to synthesize the obtained words And analyzing the mutual master-slave and modification relationship between the phrases, identifying the semantics and intention of the character text, and generating a search keyword group, wherein the search keyword group includes a primary attribute keyword group and a secondary attribute keyword group, and the dependent attribute The keyword group is used to modify the attributes of the object characterized by the primary attribute keyword group.
  • the calculating module is specifically configured to:
  • the hit_ratio primary is a hit ratio of the primary attribute keyword group
  • the hit_ratio se ⁇ ndary is a hit ratio of the dependent attribute keyword group
  • the hit rate is a number of hits Search for the ratio of the total number of keywords in the keyword group.
  • the adding module is specifically configured to: determine a maximum confidence of the multimedia file to meet the preset condition. And obtaining, in the multimedia list, a multimedia file with the highest degree of confidence in the multimedia file, and adding the multimedia file with the highest confidence of the multimedia file to the text.
  • the device further includes a determining module, where the determining module is configured to: if the retrieval key If any keyword of the phrase misses the multimedia file, it is determined that there is no multimedia file matching the search keyword group in the preset multimedia library.
  • the device further includes a determining module, where the determining module is configured to: determine the multimedia file Confidence and preset confidable threshold; if the confidence of the multimedia file is greater than or equal to the preset confidable threshold, the multimedia file is retained; if the confidence of the multimedia file is less than the preset confidable The value, then the multimedia file is deleted from the multimedia list in which it is located.
  • the device further includes a sorting module, where the sorting module is configured to: follow the confidence of the multimedia file The degree is from high to low, sorting the multimedia files in the multimedia list.
  • the method and device for adding a multimedia file provided by the embodiment of the present invention have the following advantages: By parsing the character text, the search keyword group is obtained, so that the semantics and potential intention of the text can be known; Retrieving a keyword to retrieve a multimedia list matching the search keyword group, and adding a multimedia file with the highest degree of confidence in the multimedia file in the multimedia list to the text to which the multimedia file needs to be added, so that the added multimedia file is more in line with the context and more accurate , simplifying the operation of adding multimedia files and improving the user experience.
  • FIG. 1 is a schematic flowchart of a method for adding a multimedia file according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a music multimedia classification tree according to an embodiment of the present invention
  • 2b is a schematic diagram of a multi-class multimedia library according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of another method for adding a multimedia file according to an embodiment of the present invention
  • FIG. 3b is a schematic diagram of a syntax analysis tree according to an embodiment of the present invention
  • FIG. 4 is another schematic flowchart of a method for adding a multimedia file according to an embodiment of the present invention
  • FIG. 5 is another schematic diagram of a syntax analysis tree according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of an apparatus for adding a multimedia file according to an embodiment of the present invention
  • FIG. 7 is another schematic structural diagram of an apparatus for adding a multimedia file according to an embodiment of the present invention.
  • the embodiment of the invention provides a method and a device for adding a multimedia file, which are used for retrieving multimedia from a large amount of multimedia data and adding, saving search time and improving search accuracy.
  • FIG. 1 is a schematic flowchart of a method for adding a multimedia file according to an embodiment of the present invention
  • search keyword group a multimedia list that matches the search key phrase in a preset multimedia library
  • the method for adding a multimedia file may be based on an application in a language parsing system, and the system may include a knowledge base, a classifier, an inference rule base, and a multimedia library, where the knowledge base, the classifier, and the multimedia library are Pre-set.
  • the knowledge base includes a priori knowledge for assisting parsing and classifying the multimedia file by the classifier; the specific content of the knowledge base includes but is not limited to: a multimedia classification tree and an inference rule base; wherein, the multimedia classification A common classification method for tree characterizing multimedia data.
  • the multimedia classification tree is a basis for the classifier to classify multimedia files in the multimedia library, and the multimedia classification tree includes: a general multimedia classification tree. This type of classification tree specifies general classification rules for using multimedia files. For example: “Music” can be classified into “pop", “rock”, etc. according to genre. "picture” can be divided into “black and white” and "color” according to color. .
  • any multimedia file can find one or more nodes that characterize the classification of the multimedia file on the classification tree.
  • FIG. 2a shows an example of a music multimedia classification tree. It can be understood that the general multimedia classification tree is also different according to the actual situation of the multimedia data in the multimedia library, and is not specifically limited herein.
  • the inference rule base describes a rule for semantic inference of character text or vocabulary, and the composition thereof comprises: each node of the multimedia classification tree includes a keyword set that can be used to describe the node, and the keyword is included in the character text. When one or more keywords in a collection are used, the meaning of the keyword can be considered as the meaning of the corresponding node representation on the multimedia classification tree.
  • any child node on the multimedia classification tree can be inferred along the path of the child node to the root node of the multimedia classification tree.
  • the classifier uses the multimedia classification tree in the knowledge base to classify the multimedia files in the multimedia library, and outputs the multi-class multimedia library. That is, the multimedia file is mapped to the node of the multimedia classification tree according to the category information of the multimedia file.
  • a multimedia file may be mapped to nodes on one or more multimedia classification trees. For example: ⁇ Dongfeng Broken, Singer: Jay Chou, Genre: Pop ⁇ This song, when classified by singer, is mapped to the "Jay Chou" node of the multimedia classification tree of Figure 2a; when classified by genre, it is mapped to the "popular" node.
  • the multimedia library is obtained by classifying the multimedia according to the multimedia classification tree of the knowledge base by a classifier.
  • FIG. 2b is an example of a multi-class multimedia library.
  • the character text input by the user is parsed according to the established knowledge base and the multimedia library to generate a keyword set representing the semantics and intention of the character text, that is, the search keyword group.
  • the confidence level is also referred to as a reliability level, or a confidence level, a confidence coefficient, and the calculation of the confidence level may be calculated according to the search keyword group, which is not specifically limited herein.
  • the preset condition may be set to the highest confidence of the multimedia file or the confidence of the multimedia file is greater than or equal to a preset threshold, etc.
  • the maximum confidence of the multimedia file is determined to meet the preset condition, and the multimedia file with the highest confidence of the multimedia file is obtained in the multimedia list, and the multimedia file with the highest confidence of the multimedia file is added to the text. It is not intended to limit the invention.
  • the method for adding a multimedia file has the following advantages: By parsing the character text, a search keyword group is obtained, so that the semantics of the text can be known. And a potential intent; searching for a multimedia list matching the search keyword group according to the search keyword, and adding a multimedia file with the highest degree of confidence in the multimedia file in the multimedia list to the text to which the multimedia file needs to be added, so that the added multimedia file is more in line with the context Context, more accurate, simplifies the operation of adding multimedia files, improving the user experience.
  • FIG. 3a is to analyze the character text
  • the obtained search keyword group (S102) may specifically include:
  • the lexical parsing (S1021) of the character text may specifically include:
  • Step 1 Perform word segmentation on the character text
  • consecutive character texts may be divided into words, phrases, or phrases according to words, phrases, phrases, concepts, registrations, relationships, attributes, and the like in the language. For example: “Jay Chou's song”, the result of the word segmentation "Jay Jay // // song” (where " ⁇ ” means the separator between words).
  • Step 2 Identify the words, phrases, and phrases obtained after the word segmentation
  • Step 3 According to the preset synonym list, normalize the words with multiple synonymous expressions obtained by the named entity identification into standard words of the synonym group, and the standard words are the results obtained by the lexical analysis.
  • the preset synonym group list includes a plurality of synonym combinations, each synonym combination is composed of words having multiple synonymous expressions, and the words having multiple synonymous expressions are normalized to the synonyms.
  • Combined standard word For example: "Jay Chou, Jay Chou, Jay” is a group of synonyms, in which "Jay Chou” is the standard word of the synonym group, such as "Zhou Dong” in the character text "Zhou Dong's Song” is standardized as "Jay Chou”.
  • syntactic analysis analyzes character text from the grammatical level of natural language
  • the syntactic parsing (S1022) of the result obtained by the lexical parsing may specifically include: Step 1: performing part-of-speech tagging on the result obtained by the lexical analysis;
  • each word, phrase, and phrase in the output of the lexical analysis is assigned an appropriate part of speech.
  • the output of "Zhou Jielun's song” after the part-of-speech tagging can be "I-structure auxiliary word for the Jay Chou I name // song I noun", where the content after ⁇ " indicates the part of speech of the preceding word.
  • Step 2 Analyze the output result after the part-of-speech tagging, obtain the master-slave and modified relationship between the words and phrases in the output result, and generate a corresponding parse tree.
  • Figure 3b is a schematic diagram of the parsing tree corresponding to the output of the character text "Jay Jay's Song”.
  • S1023 Perform semantic analysis on the result of syntactic parsing, and output a search keyword group.
  • the semantic analysis analyzes the meaning, syntactic structure of the phrase itself, and combines the prior knowledge in the preset knowledge base to analyze the entities, relationships, topics, intentions, etc. involved in the character text, and generate related search keyword groups. .
  • the search keyword group may include a primary attribute keyword group and a secondary attribute keyword group, and the dependent keyword group is used to modify an attribute of the object represented by the primary attribute keyword group. For example: If the search keyword group is shaped like " ⁇ Dongfeng Broken, Singer: Jay Chou, Genre: Pop ⁇ ", among them, "Dongfeng Broken” is the main attribute keyword group, "Singer: Jay Chou” and “Genre: Pop” are attribute keyword groups. "Jay Chou” expresses the "singer” attribute of "Dongfeng Broken”.
  • the functions provided by the semantic parsing include:
  • the keywords in the character text are extracted to determine the master-slave and modification relationship between the multiple key words.
  • “Zhou Jielun's Dongfeng Broken” based on the results of lexical analysis, word segmentation and named entity recognition, can extract the keywords “Zhou Jielun” and “Dongfeng broken”, and then according to the syntax analysis of the parse analysis tree can be known as "Zhou Jielun” as "Dongfeng broken”
  • the attributive, used to modify the "Dongfeng break” based on the above information, you can obtain the decorative relationship between the keywords: ⁇ Dongfeng broken Jay ⁇ ; Among them, "" indicates the modified relationship, Jay Chou as an attribute value of Dongfeng.
  • semantic reasoning is used to identify the latent semantics of character text. For example: “Jay Jay's latest single”, after lexical analysis to generate “Zhou Jielun's latest / / / single”; after syntactic analysis to generate “Zhou Jielun I noun / I structure auxiliary words / / latest I adjective ⁇ single I noun
  • the "single” is reasoned to "music”
  • the "newest” is reasoned to the "release time” attribute of music
  • Jay Chou is inferred to the "singer” attribute of music.
  • the potential meaning of the character text is recognized. For example: “Today's mood is very lost”, according to the inference rules in the knowledge base, in the multimedia classification tree described in Figure 2a, the set of keywords for the node “sentimental” is ⁇ sad, lost, bad ⁇ , when the character
  • the text is "Today's mood is very lost”
  • the language parsing system includes a thesaurus that stores associations between specific words, phrases, phrases, and entities indicating their concepts, attributes, and relationships.
  • the thesaurus can also save synonyms, synonyms, entity nouns, etc. of the words, in combination with the multimedia library and the knowledge base to achieve the analysis of the character text.
  • the matching relationship of the multimedia list matching the search keyword group may include all hits and partial hits, and the primary attribute keyword group of the search keyword group and the slave attribute keyword group may have different weight values when hit, respectively, respectively, w primary and ⁇ secondary,
  • the sum of the w primary and the ⁇ secondary is preset to be 1.
  • the description of the multimedia file contains a keyword in the search keyword group, it indicates that the keyword hits, and the keyword misses.
  • the keyword is "Jay Chou”
  • the description of the multimedia file is ⁇ Dongfeng Broken, Singer: Jay Chou ⁇
  • the hit rate (hit_ratio) of the search key phrase is the ratio of the number of hit keywords to the total number of keywords in the search keyword group.
  • the calculating a confidence (S104) of the multimedia file in the multimedia list may include:
  • the keywords in the search keyword group all hit the multimedia file, the all hit multimedia files are marked as related, and the confidence of the all hit multimedia files is set to 1.
  • the search keyword group is ⁇ Dongfeng Broken ⁇
  • the song in the multimedia library is named Dongfeng Broken Node
  • Beckham Dongfeng is broken
  • Genre: Pop ⁇ node is hit
  • the keyword "Dongfeng Broken” is completely matched, so will be trusted
  • the degree is determined to be 1.
  • the keyword portion of the search keyword group hits the multimedia file
  • the partially hit multimedia file is marked as relevant, and the formula is used:
  • the confidence is the confidence level
  • the w primary is the weight value of the primary attribute keyword group
  • the w se ⁇ ndary is the weight value of the secondary attribute keyword group
  • the hit_ratio primary is the hit of the primary attribute keyword group.
  • Rate the 1 ⁇ 10 11 ( 1 £17 is the hit rate from the attribute keyword group.
  • the search keyword group is ⁇ Kissue, Singer: Jay Chou ⁇
  • the search keyword group the main attribute keyword is "Kissing"
  • the attribute keyword is "Singer: Jay Chou”.
  • the node's relevance confidence is w primary * 0 + w se ⁇ ndary *l
  • FIG. 4 is another schematic flowchart of the method for adding a multimedia file, where the calculating the confidence level of the multimedia file in the multimedia list (S104) After that, it can also include:
  • step S1041a or S1041b the multimedia file with the greatest confidence in the multimedia file in the updated multimedia list is added to the text.
  • the multimedia files in the multimedia list are sorted according to the high to low confidence of the multimedia files.
  • the sorting can be assisted by using attributes other than the primary and secondary attributes in the search keyword group of the multimedia file.
  • the search key phrase ⁇ Kissue, singer: Andy Lau ⁇ retrieved two multimedia files with the same confidence level ⁇ Kissue, singer: Jacky Cheung ⁇ (marked as a) and ⁇ Kissue, singer: Dawn ⁇ (marked as b).
  • the multimedia file a and the multimedia file b can be sorted according to the attributes such as "play times" and "creation time", which are not specifically limited this time.
  • the method for adding a multimedia file has the following advantages: by performing lexical, syntactic and semantic analysis on the character text, the search keyword group is obtained, so that the semantics and potential intention of the text can be known;
  • the keyword searches and retrieves the multimedia list matching the keyword group, and adds the multimedia file with the highest confidence of the multimedia file in the multimedia list to the text that needs to add the multimedia file, so that the added multimedia file is more in line with the context and more accurate. Simplifies the operation of adding multimedia files to improve the user experience.
  • the entity noun table, the synonym table in the thesaurus, the words of the character text are segmented, the named entities in the word segmentation results are identified, and the words with synonymous terms are standardized.
  • Generate lexical analysis results For example: “The latest single of Jay Chou's participle” is "Jay Jay // // latest // single"("//” indicates the separator of the word segmentation vocabulary); the result of the named entity recognition is "Jay Chou- The name of the person; the result of the standardization of synonyms is "single song”. "Jay Chou's latest single” The final result of the lexical analysis module is converted into "Jay Chou I name // // latest // song”
  • FIG. 5 is a schematic diagram of a corresponding syntax analysis tree in the embodiment.
  • the meaning of the phrase itself, the syntactic structure, the inference rules in the knowledge base are analyzed, the semantics and intentions of the text contained in the syntactic analysis result are analyzed, and the retrieval key phrases used by the retrieval module are output.
  • the syntactic analysis result data "I-structure auxiliary word of Jay Chou I name / / latest I adjective / / song I noun" and the grammar tree corresponding to Figure 5
  • the master-slave and modification relationships between the keywords are obtained.
  • “Jay Chou” and “Latest” are used as the attributives of the songs to modify the songs.
  • the modified relationship can be obtained as ⁇ song Jay Chou, song latest ⁇ .
  • the keyword group and its modification relationship are semantically inferred.
  • the reasoning keyword describes the time attribute.
  • the multimedia file matching the search keyword group ( ⁇ music, singer: Jay Chou, release time: recent ⁇ ) is retrieved from the multimedia library, and the confidence of the multimedia file is calculated.
  • the multi-class multimedia library is shown in Fig. 2b.
  • the main attribute "music" in the search keyword group can be used to locate the retrieved target object into the music multimedia library.
  • the search object is further Zoom out to link to the "Jay Chou” node music list.
  • the comparison is related to "Jay Chou”
  • the confidence level of each multimedia file in the multimedia list is calculated by the confidence calculation formula.
  • the confidence calculation formula for a multimedia file can be:
  • Confidence w primary * hit_ratio primary + w secondary * hit_ratio se compares the confidence of each multimedia file in the calculated multimedia list with the preset confidence threshold, if the calculated confidence is less than the preset confidence level Value, then remove the multimedia file from the multimedia list. After filtering through this step, an updated list of trusted multimedia is obtained.
  • the specific content is: For multimedia files in the multimedia list, the related multimedia is sorted according to its confidence level from high to low. For multimedia files with the same confidence level, the multimedia files can be sorted using attributes other than the primary and secondary attributes in the search keyword group. For example, sort by the properties such as "play times" and "creation time" of the multimedia file.
  • the method for adding a multimedia file has the following advantages: by performing lexical, syntactic and semantic analysis on the character text, the search keyword group is obtained, so that the semantics and potential intention of the text can be known;
  • the keyword searches and retrieves the multimedia list matching the keyword group, and adds the multimedia file with the highest confidence of the multimedia file in the multimedia list to the text that needs to add the multimedia file, so that the added multimedia file is more in line with the context and more accurate. Simplifies the operation of adding multimedia files to improve the user experience.
  • the embodiment of the present invention further provides an apparatus based on the foregoing method for adding a multimedia file.
  • the meaning of the noun is the same as the method of adding the multimedia file, and the specific implementation details can refer to the description in the method embodiment.
  • FIG. 6 is a schematic structural diagram of a device 600 for adding a multimedia file according to an embodiment of the present disclosure, where the device 600 for adding a multimedia file may include:
  • the obtaining module 601 is configured to obtain character text.
  • the parsing module 602 is configured to parse the character text to obtain a search keyword group; and the searching module 603 is configured to search and retrieve the preset multimedia library according to the search keyword group Searching for a multimedia list matching the keyword group;
  • the calculating module 604 is configured to calculate a confidence level of the multimedia file in the multimedia list
  • the adding module 605 is configured to: if the confidence level of the multimedia file in the multimedia list meets the preset condition, the confidence level meets the preset condition Add multimedia files to the text.
  • the device for adding a multimedia file may be based on an application in a language parsing system, which may include a knowledge base, a classifier and a multimedia library, the knowledge base, the classifier and the multimedia library being pre-preset.
  • the knowledge base, the inference rule base, the classifier, and the multimedia library may be referred to the specific description in the corresponding method embodiment, and is not specifically limited herein.
  • the preset condition may be set to the highest confidence of the multimedia file or the confidence of the multimedia file is greater than or equal to a preset threshold, and in some embodiments, if the multimedia file is The maximum degree of confidence is determined to meet the preset condition, and the adding module 605 is specifically configured to: obtain a multimedia file with the highest confidence of the multimedia file in the multimedia list, and add the multimedia file with the highest confidence of the multimedia file.
  • the examples herein do not limit the invention.
  • the parsing module 602 may specifically include: a first parsing unit, configured to perform lexical parsing on the character text;
  • a second parsing unit that parses the result of the lexical parsing
  • the third analysis unit performs semantic analysis on the result of the syntax analysis and outputs a search keyword group.
  • the first parsing unit may be specifically configured to: perform word segmentation on the character text; perform named entity recognition on the words, phrases, and phrases obtained after the word segmentation; according to the preset synonym group list, A word having a plurality of synonymous expressions obtained after the name entity recognition is normalized into a standard word of the synonym group, and the standard word is the result obtained by the lexical analysis.
  • consecutive character texts may be divided into words, phrases, or phrases according to words, phrases, phrases, concepts, registrations, relationships, attributes, and the like in the language.
  • “Jay Chou's song” the result of the word segmentation output "Jay Jay // // song” (where "//” means the separator between words); identifies a specific meaning entity in a word, phrase, or phrase, mainly Including people's names, place names, etc.
  • the named entity recognition can output "Jay Chou-person name", “Dongfeng broken-song name”; it can be understood that the preset synonym group list includes multiple synonym combinations, each synonym combination Consists of words with multiple synonymous expressions, and normalizes these words with multiple synonymous expressions The standard word for this synonym combination.
  • “Jay Chou, Jay Chou, Jay” is a group of synonyms, in which "Jay Chou” is the standard word of the synonym group, such as "Zhou Dong” in the character text "Zhou Dong's Song” is standardized as "Jay Chou”.
  • the second parsing unit parses the character text from the grammatical level of the natural language.
  • the second parsing unit may be specifically configured to: perform part-of-speech tagging on the result of the lexical parsing; and output the result after the part-of-speech tagging
  • the analysis is performed to obtain the main-slave and modified relationship between the words and phrases in the output result, and generate a corresponding parse tree.
  • each word, phrase, phrase in the output of the lexical analysis is assigned a suitable part of speech.
  • the output of "Zhou Jielun's song” after the part-of-speech tagging can be "Zhou Jielun I name // I structure auxiliary word / / song I noun", where the content after ⁇ " indicates the part of the word before; as shown in Figure 3b is the character text In the example of "Jay Jay's Song", a schematic diagram of the parsing tree corresponding to the output.
  • the third parsing unit may be specifically configured to: combine the preset knowledge base, analyze the syntactic parsing words, the principal-slave relationship between the phrases, and modify the relationship, and identify the semantics of the character text. And an intent, and generating a search keyword group, wherein the search keyword group includes a primary attribute keyword group and a secondary attribute keyword group, and the secondary attribute keyword group is used to modify an attribute of the object represented by the primary attribute keyword group.
  • the semantic analysis analyzes the meaning, syntactic structure of the phrase itself, and combines the prior knowledge in the preset knowledge base to analyze the entities, relationships, topics, intentions, etc. involved in the character text, and generate related search keyword groups. .
  • the search keyword group may include a primary attribute keyword group and a secondary attribute keyword group, and the dependent keyword group is used to modify an attribute of the object represented by the primary attribute keyword group. For example: If the search keyword group is shaped like " ⁇ Dongfeng Broken, Singer: Jay Chou, Genre: Pop ⁇ ", among them, "Dongfeng Broken” is the main attribute keyword group, "Singer: Jay Chou” and “Genre: Pop” are attribute keyword groups. "Jay Chou” expresses the "singer” attribute of "Dongfeng Broken”.
  • the functions provided by the semantic parsing include:
  • the keywords in the character text are extracted to determine the master-slave and modification relationship among the multiple keywords.
  • “Zhou Jielun's Dongfeng Broken” based on the results of lexical analysis, word segmentation and named entity recognition, can extract the keywords “Zhou Jielun” and “Dongfeng broken”, and then according to the syntax analysis of the parse analysis tree can be known as "Zhou Jielun” as “Dongfeng broken” Attributive, used to modify "east The wind breaks, based on the above information, you can get the modified relationship between the keywords: ⁇ Dongfeng broke Jay Chou ⁇ ; Among them, "" indicates the modification relationship, Jay Chou as an attribute value of Dongfeng.
  • semantic reasoning is performed to identify the latent semantics of the character text. For example: “Jay Jay's latest single”, after lexical analysis to generate “Jay Jay // // latest / single”; after syntactic analysis to generate “Zhou Jielun I noun / I structure auxiliary words / / latest I adjective ⁇ single I noun”; according to the inference rules in the knowledge base, infering "single” to "music", inferring “latest” to the "release time” attribute of music, and inferring Jay Chou to the "singer” attribute of music, then The underlying semantics of the full sentence of "Jay Chou's latest single” is "Singer is the music that Jay Chou's release time is closest to the current time", and the corresponding keyword group is ⁇ Music, Singer: Jay Chou, Release time: Recent ⁇ .
  • the preset knowledge base contains two pieces of music, the details are: ⁇ Dongfeng Broken, Release time: 2012-10-21, Singer: Jay Chou ⁇ and ⁇ Blue and White Porcelain, Release time: 2013-11-30, Singer: Jay Chou ⁇ . Then, by comparing the time attributes of the two songs, "Blue-and-white porcelain" is released later than "Dongfeng Broken", which is the target multimedia file of character text semantics.
  • the potential meaning of the character text is recognized. For example: “Today's mood is very lost”, according to the inference rules in the knowledge base, in the multimedia classification tree described in Figure 2a, the set of keywords for the node “sentimental” is ⁇ sad, lost, bad ⁇ , when the character
  • the text is "Today's mood is very lost”
  • the language parsing system includes a thesaurus that stores associations between specific words, phrases, phrases, and entities indicating their concepts, attributes, and relationships.
  • the thesaurus can also save synonyms, synonyms, entity nouns, etc. of the words, in combination with the multimedia library and the knowledge base to achieve the analysis of the character text.
  • the search keyword group after obtaining the search keyword group, searching, according to the search keyword group, a multimedia list matching the search keyword group in a preset multimedia library, wherein the search is performed
  • the matching relationship of the keyword group matching multimedia list may include all hits and partial hits, and the primary attribute keyword group of the search keyword group and the attribute keyword group hit may have different weight values, respectively, w primary and ⁇ secondary, respectively
  • the setting is preset
  • the sum of Wp rimary and the W seC ondary is 1. If the description of the multimedia file contains a keyword in the search keyword group, it indicates that the keyword hits, and the keyword misses. For example: The keyword is "Jay Chou", the description of the multimedia file is ⁇ Dongfeng Broken, Singer: Jay Chou ⁇ , then the keyword "Jay Chou" hits.
  • the hit rate (hit_ratio) of the search keyword group is the ratio of the number of hit keywords to the total number of keywords in the search keyword group. The specific calculation and analysis process is as follows:
  • the computing module 604 is configured to:
  • the all hit multimedia files are marked as relevant, and the confidence of the all hit multimedia files is set to one. If the keywords in the search keyword group all hit the multimedia file, the all hit multimedia files are marked as related, and the confidence of the all hit multimedia files is set to 1.
  • the search keyword group is ⁇ Dongfeng broken ⁇
  • the song in the multimedia library is named Dongfeng broken node, then ⁇ Dongfeng broken, singer: Jay Chou, genre: pop ⁇ node is hit, and the keyword "Dongfeng broken" is completely matched, so will be trusted
  • the degree is determined to be 1.
  • calculation module 604 can also be used to:
  • the partially hit multimedia file is marked as relevant, and the formula is used:
  • the hit_ratio primary is a hit ratio of the primary attribute keyword group
  • the hit_ratio se ⁇ ndary is a hit ratio of the dependent attribute keyword group
  • the hit rate is a number of hits The ratio of the number of all keywords in the keyword group. For example: search keyword group is ⁇ kiss Another 1 J, singer: Jay Chou ⁇ , the search keyword group, the main attribute keyword is "Kissue”, the attribute keyword is "Singer: Jay Chou”.
  • the main attribute keyword part hits the node ⁇ Kissue, singer: Jacky Cheung, music mood: sad, romantic ⁇ , hit rate is 1, subordinate keyword miss, so the correlation confidence of the node is: w prim£uy * 1 + w se ⁇ nd£uy *0; From the attribute keyword hit ⁇ Dongfeng Broken, Singer: Jay Chou, Genre: Pop ⁇ node, the node's relevance confidence is w primary * 0 + w se ⁇ ndary *1 .
  • the device may further include a determining module, where the determining module is configured to: if any keyword of the search keyword group fails to hit the multimedia file, determine that the preset multimedia library does not There is a multimedia file that matches the set of search keywords. That is, it is not necessary to calculate the confidence of the multimedia file. In this case, the addition operation of the multimedia file is not performed.
  • the device may further include a determining module, where the determining module is configured to: determine a confidence level of the multimedia file and a preset credible threshold; if the confidence of the multimedia file is greater than or equal to the preset credible The value of the multimedia file is retained; if the confidence of the multimedia file is less than the preset confidence threshold, the multimedia file is deleted from the multimedia list in which it is located. Add the multimedia file with the highest confidence in multimedia files in the updated multimedia list to the text.
  • the device further includes a sorting module, where the ranking module is configured to: after calculating the confidence of the multimedia file in the multimedia list, in order to determine the higher the confidence of the multimedia file in the multimedia list, The multimedia files in the multimedia list are sorted according to the confidence level of the multimedia file from high to low.
  • the ranking module is configured to: after calculating the confidence of the multimedia file in the multimedia list, in order to determine the higher the confidence of the multimedia file in the multimedia list, The multimedia files in the multimedia list are sorted according to the confidence level of the multimedia file from high to low.
  • the sorting can be assisted by using attributes other than the primary and secondary attributes in the search keyword group of the multimedia file.
  • the search key phrase ⁇ Kissue, singer: Andy Lau ⁇ retrieved two multimedia files with the same confidence level ⁇ Kissue, singer: Jacky Cheung ⁇ (marked as a) and ⁇ Kissue, singer: Dawn ⁇ (marked as b).
  • the multimedia file a and the multimedia file b can be sorted according to the attributes such as "play times" and "creation time", which are not specifically limited this time.
  • an apparatus for adding a multimedia file provided by an embodiment of the present invention has the following advantages: by performing lexical, syntactic, and semantic analysis on character texts, a search keyword group is obtained, thereby knowing the semantics and potential intention of the text; The keyword searches and retrieves the multimedia list matching the keyword group, and adds the multimedia file with the highest confidence of the multimedia file in the multimedia list to The text of the multimedia file needs to be added, so that the added multimedia file is more in line with the context and more accurate, which simplifies the operation of adding the multimedia file and improves the user experience.
  • FIG. 7 is another schematic structural diagram of a device for adding a multimedia file according to an embodiment of the present invention.
  • the system architecture of the device for adding a multimedia file provided by the present invention includes but is not limited to one or more processors, memory, An external interface, an input device, an output device, a storage device, and at least one communication bus for implementing connection communication between the devices and the like.
  • the processor may be any device that controls all operations on the mobile terminal, including but not limited to instructions that perform short message parsing and services, and advertisement recommendations.
  • the processor may be not limited to one or more central processing units (CPUs), GPUs (Graphic Processing Units), Field Programmable Gate Arrays (FPGAs), DSPs (Digital Signal Processors), ASIC (Application Specific Integrated Circuit), Programmable Logic Device (PLD), etc., or a mixture of the above devices.
  • the memory may be any device that caches the data and sequences of instructions required by the processor to perform operations on the mobile terminal, including but not limited to data and instruction sequences that are required to run short message parsing and services, advertisement recommendations.
  • the memory can be, but is not limited to, RAM, ROM, flash memory, etc., or a mixture of the above devices.
  • the external interface may be an interface between any mobile terminal and an external device or a network, including but not limited to an interface required to obtain external services and advertisement information.
  • the external interface may be, but is not limited to, an Ethernet interface, a DSL interface, an RF interface, Bluetooth, etc., or a mixture of the above interfaces.
  • Any network transport protocol can be run on the external interface, including but not limited to USB, cable, fiber, wireless (including but not limited to WiFi, 2G/3G/4G networks) and other transport protocols.
  • the input device may be any device that obtains user input and information from a mobile terminal.
  • the input device can be, but is not limited to, a keyboard, a mouse, a touch screen, a device button, a microphone, various sensors (such as GPS, level sensor, gravity sensor, etc.), or a mixture of the above devices.
  • the output device may be any device that displays the processing results of the mobile terminal, including but not limited to displaying recommended services and advertisements.
  • the output device can be, but is not limited to, a screen, a sounder, a headset, a printer, a vibrator, etc., or a mixture of the above.
  • the storage device can be any device that stores mobile terminal programs and data.
  • Storage devices include but not Limited to flash memory, hard disk, CD-ROM, etc., or a mixture of the above hardware.
  • program instructions are stored in the storage device, and the program instructions may be executed by a processor, and the processor specifically performs the following steps:
  • the processor is configured to parse the character text, and obtaining a search keyword group includes: performing lexical analysis on the character text; syntactically parsing a result obtained by lexical analysis; performing semantics on a result of syntactic parsing Parse, output the search keyword group.
  • the processor is configured to perform lexical parsing on the character text, including: segmenting the character text; performing named entity recognition on a word, a phrase, and a phrase obtained after the word segmentation; and according to the preset synonym group list, A word with a plurality of synonymous expressions obtained after the name entity recognition is normalized into a standard word of the synonym group, and the standard word is the result of the lexical analysis.
  • the processor is configured to perform syntax analysis on the result obtained by the lexical analysis, including: performing part-of-speech tagging on the result of the lexical parsing; analyzing the output result after the part-of-speech tagging, and obtaining the word in the output result, The masters and phrases between the phrases are modified, and the corresponding parse tree is generated.
  • the processor is configured to perform semantic analysis on the result of the syntax parsing, and output a retrieval keyword group, including:
  • search keyword group includes the main attribute
  • the keyword group and the dependent keyword group are used to modify the attributes of the object characterized by the primary attribute keyword group.
  • the processor is configured to calculate a confidence level of the multimedia file in the multimedia list, including:
  • the keyword portion of the search keyword group hits the multimedia file
  • the partially hit multimedia file is marked as relevant, and the formula is used:
  • the hit_ratio primary is a hit ratio of the primary attribute keyword group
  • the hit_ratio se ⁇ ndary is a hit ratio of the dependent attribute keyword group
  • the hit rate is a number of hits The ratio of the number of all keywords in the keyword group.
  • the processor is configured to: when determining that the confidence level of the multimedia file in the multimedia list meets a preset condition, adding the multimedia file whose confidence degree meets the preset condition to the text, includes: maximizing the confidence of the multimedia file It is determined that the multimedia file with the highest confidence of the multimedia file is obtained in the multimedia list, and the multimedia file with the highest confidence of the multimedia file is added to the text.
  • the processor is further configured to: if any keyword of the search keyword group fails to hit the multimedia file, determine that the preset multimedia library does not match the search keyword group Multimedia files.
  • the processor may further be configured to: determine a confidence level of the multimedia file and a preset credible threshold; if the confidence of the multimedia file is greater than Or equal to the preset credible threshold, the multimedia file is retained; if the confidence of the multimedia file is less than the preset credible threshold, the multimedia file is deleted from the multimedia list in which it is located.
  • the processor may be further configured to: sort the multimedia files in the multimedia list according to a high to low confidence of the multimedia file.
  • an apparatus for adding a multimedia file provided by an embodiment of the present invention has the following advantages: by performing lexical, syntactic, and semantic analysis on character texts, a search keyword group is obtained, thereby knowing the semantics and potential intention of the text; The keyword searches and retrieves the multimedia list matching the keyword group, and adds the multimedia file with the highest confidence of the multimedia file in the multimedia list to The text of the multimedia file needs to be added, so that the added multimedia file is more in line with the context and more accurate, which simplifies the operation of adding the multimedia file and improves the user experience.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct connection or communication connection shown or discussed may be an indirect engagement or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
  • the components displayed by the unit may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, and a read-only memory (ROM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种添加多媒体文件的方法及设备,用于从大量多媒体数据中,检索出多媒体并添加,节省查找时间,提高查找准确率。该方法包括:获取字符文本;对所述字符文本进行解析,得到检索关键词组;根据所述检索关键词组,在预置的多媒体库中检索与所述检索关键词组相匹配的多媒体列表;计算所述多媒体列表中多媒体文件的置信度;若确定出所述多媒体列表中多媒体文件的置信度满足预设条件时,将置信度满足预设条件的多媒体文件添加至文本。

Description

一种添加多媒体文件的方法和设备
本申请要求于 2014 年 2 月 26 日提交中国专利局、 申请号为 201410067024.9、 发明名称为 "一种添加多媒体文件的方法及设备" 的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域, 尤其是涉及一种添加多媒体文件的方法及设 备。
背景技术
随着社交网络、 即时通讯的不断发展,人与人之间沟通交流的信息载体包 含了越来越多的多媒体(如图片、 音频、 视频等)数据。 目前, 当用户想要在 文本编辑过程(如微博、 短信、 WORD 文档、 电子邮件等) 中插入多媒体数 据时, 一般都需要通过 "复制、 粘贴" 的方式, 或者通过特定的 "插入工具" 来实现。
可是发明人在实现本发明的过程中发现目前这些插入多媒体数据的方式 都不可避免的需要用户去庞大的多媒体库中寻找待插入的目标数据,这种方式 操作繁瑣, 查找的准确率不高, 并且耗时。
发明内容
本发明实施例提供了一种添加多媒体文件的方法及设备,用于从大量多媒 体数据中, 检索出多媒体并添加, 节省查找时间, 提高查找准确率。
有鉴于此, 本发明第一方面提供一种添加多媒体文件的方法, 可包括: 获取字符文本;
对所述字符文本进行解析, 得到检索关键词组;
根据所述检索关键词组,在预置的多媒体库中检索与所述检索关键词组相 匹配的多媒体列表;
计算所述多媒体列表中多媒体文件的置信度;
若确定出所述多媒体列表中多媒体文件的置信度满足预设条件时,将置信 度满足预设条件的多媒体文件添加至文本。
在第一方面第一种可能的实施方式中, 所述对所述字符文本进行解析,得 到检索关键词组包括: 对所述字符文本进行词法解析;
对词法解析得到的结果进行句法解析;
对句法解析得到的结果进行语义解析 输出检索关键词组。
结合第一种可能的实施方式,在第二种可能的实施方式中, 所述对所述字 符文本进行词法解析, 包括:
对所述字符文本进行分词;
对分词后得到的词语、 词组、 短语进行命名实体识别;
根据预置同义词组列表,将进行命名实体识别后得到的拥有多种同义表述 的词语规范化为同义词组的标准词, 所述标准词即为所述词法解析得到的结 果。
结合第一种或第二种可能的实施方式,在第三种可能的实施方式中, 所述 对词法解析得到的结果进行句法解析, 包括:
对所述词法解析得到的结果进行词性标注;
对词性标注后的输出结果进行分析,得到输出结果中的词语、词组之间的 彼此主从、 修饰关系, 并生成对应的语法分析树。
结合第一种或第二种或第三种可能的实施方式,在第四种可能的实施方式 中, 所述对句法解析得到的结果进行语义解析, 输出检索关键词组, 包括: 结合预置知识库, 对句法解析得到的词语、 词组之间的彼此主从、修饰关 系进行分析, 识别字符文本的语义和意图, 并生成检索关键词组, 其中, 所述 检索关键词组包括主属性关键词组和从属性关键词组,所述从属性关键词组用 于修饰所述主属性关键词组表征的对象的属性。
结合第四种可能的实施方式,在第五种可能的实施方式中, 所述计算所述 多媒体列表中多媒体文件的置信度, 包括:
若所述检索关键词组中关键词全部命中多媒体文件,则将全部命中的多媒 体文件标记为相关, 且将所述全部命中的多媒体文件的置信度设置为 1 ; 若所述检索关键词组中关键词部分命中多媒体文件,则将部分命中的多媒 体文件标记为相关, 且利用公式:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose
计算所述部分命中的多媒体文件的置信度, 其中, 所述 confidence为所述 置信度, 所述 wprimary为所述主属性关键词组的权重值, 所述 wse∞ndary为所述从 属性关键词组的权重值, 所述 hit_ratioprimary为所述主属性关键词组的命中率, 所述 hit_ratiose∞ndary为所述从属性关键词组的命中率, 所述命中率为命中的关 键词个数占检索关键词组中全部关键词个数的比值。
结合第一方面或第一种至第五种任一种可能的实施方式,在第六种可能的 实施方式中,所述若确定出所述多媒体列表中多媒体文件的置信度满足预设条 件时, 将置信度满足预设条件的多媒体文件添加至文本, 包括:
将多媒体文件置信度最大确定为满足预设条件,在所述多媒体列表中获取 到多媒体文件置信度最大的多媒体文件,并将所述多媒体文件置信度最大的多 媒体文件添加至文本。
结合第一方面或第一种至第六种任一种可能的实施方式,在第七种可能的 实施方式中, 所述方法还包括:
若所述检索关键词组的任一关键词均未命中多媒体文件,则确定出所述预 置的多媒体库中不存在与所述检索关键词组相匹配的多媒体文件。
结合第一方面或第一种至第六种任一种可能的实施方式,在第八种可能的 实施方式中, 所述计算所述多媒体列表中多媒体文件的置信度之后, 包括: 判断所述多媒体文件的置信度与预设可置信阔值;
若多媒体文件的置信度大于或者等于所述预置可置信阔值,则保留所述多 媒体文件;
若多媒体文件的置信度小于所述预置可置信阔值,则将所述多媒体文件从 其所处的多媒体列表中删除。
结合第一方面或第一种至第六种任一种可能的实施方式,在第九种可能的 实施方式中, 所述计算所述多媒体列表中多媒体文件的置信度之后, 包括: 按照多媒体文件的置信度由高到低,对多媒体列表中的多媒体文件进行排 序。
本发明第二方面提供一种添加多媒体文件的设备, 可包括:
获取模块, 用于获取字符文本;
解析模块, 用于对所述字符文本进行解析, 得到检索关键词组; 检索模块, 用于根据所述检索关键词组,在预置的多媒体库中检索与所述 检索关键词组相匹配的多媒体列表;
计算模块, 用于计算所述多媒体列表中多媒体文件的置信度;
添加模块,用于若确定出所述多媒体列表中多媒体文件的置信度满足预设 条件时, 将置信度满足预设条件的多媒体文件添加至文本。
在第二方面第一种可能的实施方式中, 所述解析模块, 包括:
第一解析单元, 用于对所述字符文本进行词法解析;
第二解析单元, 对词法解析得到的结果进行句法解析;
第三解析单元,对句法解析得到的结果进行语义解析,输出检索关键词组。 结合第一种可能的实施方式,在第二种可能的实施方式中, 所述第一解析 单元, 具体用于: 对所述字符文本进行分词; 对分词后得到的词语、 词组、 短 语进行命名实体识别; 根据预置同义词组列表, 将进行命名实体识别后得到的 拥有多种同义表述的词语规范化为同义词组的标准词;所述标准词即为所述词 法解析得到的结果。
结合第一种或第二种可能的实施方式,在第三种可能的实施方式中, 所述 第二解析单元, 具体用于: 对所述词法解析得到的结果进行词性标注; 对词性 标注后的输出结果进行分析, 得到输出结果中的词语、 词组之间的彼此主从、 修饰关系, 并生成对应的语法分析树。
结合第一种或第二种或第三种可能的实施方式,在第四种可能的实施方式 中,所述第三解析单元,具体用于: 结合预置知识库,对句法解析得到的词语、 词组之间的彼此主从、 修饰关系进行分析, 识别字符文本的语义和意图, 并生 成检索关键词组, 其中, 所述检索关键词组包括主属性关键词组和从属性关键 词组, 所述从属性关键词组用于修饰所述主属性关键词组表征的对象的属性。
结合第四种可能的实施方式,在第五种可能的实施方式中,所述计算模块, 具体用于:
若所述检索关键词组中一个或多个关键词全部命中一个或多个多媒体文 件, 则将全部命中的多媒体文件标记为相关,且将所述全部命中的多媒体文件 的置信度设置为 1 ;
若所述检索关键词组中一个或多个关键词部分命中一个或多个多媒体文 件, 则将部分命中的多媒体文件标记为相关, 且利用公式: confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose
计算所述部分命中的多媒体文件的置信度, 其中, 所述 confidence为所述 置信度, 所述 wprimary为所述主属性关键词组的权重值, 所述 wse∞nd ^为所述从 属性关键词组的权重值, 所述 hit_ratioprimary为所述主属性关键词组的命中率, 所述 hit_ratiose∞ndary为所述从属性关键词组的命中率, 所述命中率为命中的关 键词个数占检索关键词组中全部关键词个数的比值。
结合第二方面或第一种至第五种任一种可能的实施方式,在第六种可能的 实施方式中, 所述添加模块具体用于: 将多媒体文件置信度最大确定为满足预 设条件,在所述多媒体列表中获取到多媒体文件置信度最大的多媒体文件, 并 将所述多媒体文件置信度最大的多媒体文件添加至文本。
结合第二方面或第一种至第六种任一种可能的实施方式,在第七种可能的 实施方式中, 所述设备还包括确定模块, 所述确定模块用于: 若所述检索关键 词组的任一关键词均未命中多媒体文件,则确定出所述预置的多媒体库中不存 在与所述检索关键词组相匹配的多媒体文件。
结合第二方面或第一种至第六种任一种可能的实施方式,在第八种可能的 实施方式中, 所述设备还包括判断模块, 所述判断模块用于: 判断所述多媒体 文件的置信度与预设可置信阔值;若多媒体文件的置信度大于或者等于所述预 置可置信阔值, 则保留所述多媒体文件; 若多媒体文件的置信度小于所述预置 可置信阔值, 则将所述多媒体文件从其所处的多媒体列表中删除。
结合第二方面或第一种至第六种任一种可能的实施方式,在第九种可能的 实施方式中, 所述设备还包括排序模块, 所述排序模块用于: 按照多媒体文件 的置信度由高到低, 对多媒体列表中的多媒体文件进行排序。
从以上技术方案可以看出,本发明实施例提供的一种添加多媒体文件的方 法及设备具有以下优点: 通过对字符文本进行解析, 得到检索关键词组, 从而 可以知道文本的语义以及潜在意图;根据检索关键词检索与检索关键词组相匹 配的多媒体列表,并将多媒体列表中多媒体文件置信度最大的多媒体文件添加 至需要添加多媒体文件的文本, 从而使得添加的多媒体文件更符合上下文语 境, 更准确, 简化了添加多媒体文件的操作, 提高用户体验。
附图说明 为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述所需要 使用的附图作简单地介绍,显而易见地, 下面描述中的附图仅仅是本发明的一 些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还 可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的一种添加多媒体文件的方法的流程示意图; 图 2a为本发明实施例提供的一种音乐多媒体分类树示意图;
图 2b为本发明实施例提供的一种多分类的多媒体库示意图;
图 3a为本发明实施例提供的添加多媒体文件的方法的另一流程示意图; 图 3b为本发明实施例提供的一种语法分析树示意图;
图 4为本发明实施例提供的添加多媒体文件的方法的另一流程示意图; 图 5为本发明实施例提供的语法分析树另一示意图;
图 6为本发明实施例提供的一种添加多媒体文件的设备的结构示意图; 图 7为本发明实施例提供的添加多媒体文件的设备的另一结构示意图。
具体实施方式
本发明实施例提供了一种添加多媒体文件的方法及设备,用于从大量多媒 体数据中, 检索出多媒体并添加, 节省查找时间, 提高查找准确率。
为使得本发明的发明目的、 特征、 优点能够更加的明显和易懂, 下面将结 合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 下面所描述的实施例仅仅是本发明一部分实施例, 而非全部的实施 例。基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动前提 下所获得的所有其它实施例, 都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语 "第一"、 "第二"、 "第 三" "第四" 等(如果存在)是用于区别类似的对象, 而不必用于描述特定的 顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换, 以便这里 描述的本发明的实施例例如能够以除了在这里图示或描述的那些以外的顺序 实施。 此外, 术语 "包括" 和 "具有" 以及他们的任何变形, 意图在于覆盖不 排他的包含, 例如, 包含了一系列步骤或单元的过程、 方法、 系统、 产品或设 备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对 于这些过程、 方法、 产品或设备固有的其它步骤或单元。 下面通过具体实施例, 分别进行详细的说明。
请参考图 1, 图 1为本发明实施例提供的一种添加多媒体文件的方法的流 程示意图; 其中, 所述方法包括:
S101、 获取字符文本;
S102、 对所述字符文本进行解析, 得到检索关键词组;
5103、根据所述检索关键词组,在预置的多媒体库中检索与所述检索关键 词组相匹配的多媒体列表;
5104、 计算所述多媒体列表中多媒体文件的置信度;
5105、 若确定出所述多媒体列表中多媒体文件的置信度满足预设条件时, 将满足预设条件的多媒体文件添加至文本。
首先应该理解的是,所述添加多媒体文件的方法可基于语言解析系统中应 用, 该系统中可以包括知识库、 分类器、 推理规则库以及多媒体库, 所述知识 库, 分类器以及多媒体库为预先预置。
所述知识库中包含了用于辅助解析和所述分类器对多媒体文件进行分类 的先验知识; 知识库的具体内容包括但不限于: 多媒体分类树和推理规则库; 其中, 所述多媒体分类树表征多媒体数据的常用分类方法。该多媒体分类树是 分类器对多媒体库中的多媒体文件进行分类的依据, 多媒体分类树包含: 通用 多媒体分类树。该种类型的分类树规定了使用多媒体文件的通用分类规则, 例 如: "音乐"可按照流派分为 "流行"、 "摇滚"等, "图片"按照色彩可分为 "黑 白"、 "彩色"。 正因为此种分类规则对多媒体文件通用, 所以任一多媒体文件 均可在该分类树上找到一个或多个表征该多媒体文件的分类的节点。可参考图 2a, 图 2a示出了音乐多媒体分类树的一个示例, 可以理解的是, 根据多媒体 库中多媒体数据的实际情况,通用多媒体分类树也会不相同, 此处不作具体限 定。
所述推理规则库描述了对字符文本或词汇进行语义推理的规则,其构成包 括: 多媒体分类树的每个节点包含了可用于描述该节点的关键词集, 当字符文 本中包含了该关键词集合中的一个或者多个关键词时,则可认为该关键词的含 义为其在多媒体分类树上对应的节点表征的含义。 例如, 在如图 2a所示的多 媒体分类树上, 假设 "音乐" 节点的关键词集为 {音乐, 歌曲, 单曲, 曲子, 旋律, music} , 以字符文本是 "周杰伦的最新单曲" 为例, 在 "周杰伦的最新 单曲" 例子中, 对 "单曲" 关键词进行推理可确定整个字符文本的意思是 "周 杰伦的最新音乐"。 另外, 对多媒体分类树上的任一子节点, 可沿该子节点到 多媒体分类树根节点的路径向上推理。 例如, 在图 2a描述的多媒体分类树上, 假设节点 "伤感" 的关键词集合为{伤心, 失落, 糟糕 }, 当字符文本为 "今天 的心情很失落" 时, 首先可通过 "失落" 关键词推理得到 "伤感" 节点, 然后 可沿 "伤感 音乐心情 音乐" 路径推理得到 "音乐" 节点。 即, "今天的心 情^^失落" 可以用 "音乐" 来描述。
所述分类器, 其利用所述知识库中的多媒体分类树,对多媒体库中的多媒 体文件进行分类, 输出多分类的多媒体库。 即依据多媒体文件的类别信息, 将 多媒体文件映射到多媒体分类树的节点上。当从不同的角度对多媒体文件进行 分类时,一个多媒体文件可能映射到一个或者多个多媒体分类树上的节点。例 如: {东风破, 歌手: 周杰伦, 流派: 流行 }这首歌, 按歌手分类时, 被映射到 图 2a多媒体分类树的 "周杰伦" 节点; 按流派分类时, 被映射到 "流行" 节 点。
所述多媒体库,其通过分类器按照知识库的多媒体分类树对多媒体进行分 类得到, 可参考图 2b, 图 2b为多分类的多媒体库的一个示例。
其后,根据建立好的知识库和多媒体库,对用户输入的字符文本进行解析, 以生成表征字符文本语义及意图的关键词集合, 即检索关键词组。
可以理解的是,本发明实施例中,所述置信度也称为可靠度,或置信水平、 置信系数, 置信度的计算可以根据所述检索关键词组计算得出, 此处不作具体 限定。
另容易想到的是, 本发明实施例中, 所述预设条件可以设定为多媒体文件 的置信度最高或者多媒体文件的置信度大于等于预设阔值等,在某些实施方式 中, 若将多媒体文件置信度最大确定为满足预设条件, 则在所述多媒体列表中 获取到多媒体文件置信度最大的多媒体文件,并将所述多媒体文件置信度最大 的多媒体文件添加至文本, 此处举例并不造成对本发明的限定。
由上述可知,本发明实施例提供的一种添加多媒体文件的方法具有以下优 点: 通过对字符文本进行解析, 得到检索关键词组, 从而可以知道文本的语义 以及潜在意图; 根据检索关键词检索与检索关键词组相匹配的多媒体列表, 并 将多媒体列表中多媒体文件置信度最大的多媒体文件添加至需要添加多媒体 文件的文本, 从而使得添加的多媒体文件更符合上下文语境, 更准确, 简化了 添加多媒体文件的操作, 提高用户体验。
进一步地, 在本发明一些实施例中, 可参考图 3a, 图 3a为所述对所述字 符文本进行解析, 得到检索关键词组(S102 )可以具体包括:
S1021、 对所述字符文本进行词法解析;
在某些实施例方式中, 所述对所述字符文本进行词法解析(S1021 ) 可以 具体包括:
步骤一、 对所述字符文本进行分词;
可具体地, 可以将连续的字符文本按照语言中词语、 词组、 短语的概念、 注册、 关系、 属性等切分成词语、 词组、 或短语。 例如: "周杰伦的歌曲", 分 词结果输出 "周杰伦 //的 //歌曲" (其中 "〃" 表示词语间的分隔符)。
步骤二、 对分词后得到的词语、 词组、 短语进行命名实体识别;
即识别词语、 词组、 或短语中的具有特定意义的实体, 主要包括人名、 地 名等。 例如: "周杰伦的东风破", 命名实体识别可输出 "周杰伦-人名", "东 风破 -歌曲名"。
步骤三、根据预置同义词组列表,将进行命名实体识别后得到的拥有多种 同义表述的词语规范化为同义词组的标准词,所述标准词即为所述词法解析得 到的结果。
可以理解的是, 所述预置同义词组列表中包括了多个同义词组合,每个同 义词组合由拥有多种同义表述的词语构成,并将这些拥有多种同义表述的词语 规范化为该同义词组合的标准词。 例如: "周杰伦、 周董、 Jay" 为一组同义词 组, 其中 "周杰伦" 为该同义词组的标准词, 如将字符文本 "周董的歌曲" 中 的 "周董" 规范化为 "周杰伦"。
S 1022、 对词法解析得到的结果进行句法解析;
其中, 句法分析从自然语言的语法层面, 对字符文本进行解析;
在某些实施例方式中,所述对词法解析得到的结果进行句法解析( S1022 ) 可以具体包括: 步骤一、 对所述词法解析得到的结果进行词性标注;
即给词法分析的输出结果中的每个词语、词组、短语指派一个合适的词性。 例如, "周杰伦的歌曲" 经过词性标注的输出可以为 "周杰伦 I人名〃的 I结构助 词 //歌曲 I名词", 其中 Ί" 后的内容表示前面单词的词性。
步骤二、 对词性标注后的输出结果进行分析, 得到输出结果中的词语、 词 组之间的彼此主从、 修饰关系, 并生成对应的语法分析树。
可一并参考图 3b, 图 3b为字符文本为 "周杰伦的歌曲" 的例子中, 对应 输出的语法分析树示意图。
S1023、 对句法解析得到的结果进行语义解析, 输出检索关键词组。
可以理解的是, 语义解析通过分析词组本身的意义、 句法结构、 结合预置 知识库中的先验知识, 解析字符文本中涉及的实体、 关系、 主题、 意图等, 并 生成相关的检索关键词组。
所述检索关键词组可以包括主属性关键词组和从属性关键词组,所述从属 性关键词组用于修饰所述主属性关键词组表征的对象的属性。例如: 若检索关 键词组形如 "{东风破, 歌手: 周杰伦, 流派: 流行 }", 其中, "东风破" 为主 属性关键词组, "歌手: 周杰伦" 和 "流派: 流行" 为从属性关键词组, "周杰 伦" 表示了 "东风破" 的 "歌手" 属性。
其中, 可具体地, 进行语义解析提供的功能包括:
根据词法分析、 句法分析结果, 抽取字符文本中的关键词, 确定多个关键 词之间的主从、 修饰关系。 例如: "周杰伦的东风破", 依据词法分析中, 分词 和命名实体识别的结果, 可提取出关键词 "周杰伦" 和 "东风破", 然后依据 句法分析的句法分析树可知 "周杰伦" 作为 "东风破" 的定语, 用于修饰 "东 风破", 基于以上信息, 便可以获取关键词间的修饰关系: {东风破 周杰伦}; 其中, " " 表示修饰关系, 周杰伦作为东风破的一个属性值。
依据词法分析、 句法分析结果, 结合预置知识库, 进行语义推理, 识别字 符文本的潜在语义。 例如: "周杰伦的最新单曲", 经过词法分析生成 "周杰伦 〃的〃最新 //单曲"; 经过句法分析生成 "周杰伦 I名词 //的 I结构助词 //最新 I形容词 〃单曲 I名词"; 依据知识库中的推理规则, 将 "单曲"推理到 "音乐", 将 "最 新" 推理到音乐的 "发售时间" 属性, 将周杰伦推理到音乐的 "歌手" 属性, 则可以得到 "周杰伦的最新单曲"全句的潜在语义为 "歌手是周杰伦的发售时 间距离当前时间最近的音乐", 对应的关键词组为 {音乐, 歌手: 周杰伦, 发售 时间: 最近 }。假如,预置知识库中包含了两首音乐, 其详细信息为: {东风破, 发售时间: 2012-10-21, 歌手: 周杰伦 }和{青花瓷, 发售时间: 2013-11-30, 歌手: 周杰伦 }。 那么, 通过对两首歌的时间属性的比较, "青花瓷" 较 "东风 破" 推出晚, 是字符文本语义的目标多媒体文件。
依据词法分析、 句法分析结果, 结合预置知识库, 识别字符文本的潜在意 图。 例如: "今天的心情很失落", 依据知识库中的推理规则, 在图 2a描述的 多媒体分类树上, 4叚设节点 "伤感" 的关键词集合为{伤心, 失落, 糟糕 }, 当 字符文本为 "今天的心情很失落"时,首先可通过 "失落"关键词推理得到 "伤 感" 节点, 然后可沿 "伤感 音乐心情 音乐" 路径推理得到 "音乐" 节点。 即, "今天的心情很失落" 可以用 "音乐" 来描述。
需要说明的是, 所述语言解析系统中包括词库, 该词库保存了特定词语、 词组、 短语和指示其概念、 属性、 关系的实体之间的关联。 另外, 词库还可以 保存词语的同义词、 近义词, 实体名词等, 以结合多媒体库和知识库实现对字 符文本的解析。
更进一步地,在本发明一些实施例中,根据前述 S1021至 S1023得到检索 关键词组后,根据所述检索关键词组,在预置的多媒体库中检索与所述检索关 键词组相匹配的多媒体列表,其中与所述检索关键词组相匹配的多媒体列表的 匹配关系可以包括全部命中和部分命中,检索关键词组的主属性关键词组和从 属性关键词组命中时可有不同的权重值, 分别为 wprimary和 ^secondary , 本发明实 施例中, 预先设定所述 wprimary和所述 ^secondary的和为 1。
如果多媒体文件的描述中包含了检索关键词组中的某一关键词,则表示该 关键词命中, 反之该关键词未命中。 如: 关键词为 "周杰伦", 多媒体文件的 描述为 {东风破, 演唱者: 周杰伦 }, 那么关键词 "周杰伦" 命中。 所述检索关 键词组的 "命中率 (hit_ratio ),, 为命中的关键词个数占检索关键词组中全部 关键词个数的比值。
优选地, 所述计算所述多媒体列表中多媒体文件的置信度(confidence ) ( S104 ), 可以包括: 一方面, 若所述检索关键词组中关键词全部命中多媒体文件, 则将全部命 中的多媒体文件标记为相关,且将所述全部命中的多媒体文件的置信度设置为 1。 例如: 检索关键词组为{东风破 }, 多媒体库中的歌名为东风破的节点唯一, 贝 Ή东风破, 歌手: 周杰伦, 流派: 流行 }节点被命中, 且关键词 "东风破" 完 全匹配, 所以将置信度确定为 1。 再如: 当检索关键词组为 {音乐, 歌手: 周 杰伦 }时, 在多媒体分类树上, 检索到节点 "周杰伦", 且其所属的分类为 "音 乐" 大类下 "歌手" 子类, "周杰伦" 节点下包含了 "东风破"、 "双截棍" 2 个节点, 指示命中 2个多媒体文件; 该例子中, 关键词 "音乐" 与媒体分类的 大类 "音乐" 命中; 关键词 "歌手: 周杰伦" 与 "东风破" 和 "双截棍" 2个 节点的 "歌手: 周杰伦"命中, 所以, 可以认为全部命中, 所以将置信度确定 为 1
另一方面, 若所述检索关键词组中关键词部分命中多媒体文件, 则将部分 命中的多媒体文件标记为相关, 且利用公式:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose
计算所述部分命中的多媒体文件的置信度。 其中, 所述 confidence为所述 置信度, 所述 wprimary为主属性关键词组的权重值, 所述 wse∞ndary为从属性关键 词组的权重值, 所述 hit_ratioprimary为主属性关键词组的命中率, 所述 1^ ^10 11(1£117为从属性关键词组的命中率。 例如: 检索关键词组为{吻别, 歌 手: 周杰伦 }, 该检索关键词组种, 主属性关键词为 "吻别" 从属性关键词为 "歌手: 周杰伦"。 其主属性关键词部分命中了节点 {吻别, 歌手: 张学友, 音 乐心情: 伤感、 浪漫 }, 命中率为 1, 从属关键词未命中, 所以, 该节点的相 关性置信度为: wprim£uy * 1 + wse∞ndary *0; 从属性关键词命中了 {东风破, 歌手: 周杰伦, 流派: 流行 }节点, 该节点的相关性置信度为 wprimary * 0 + wse∞ndary *l 可以理解的是, 所述方法还可以包括:
若所述检索关键词组的任一关键词均未命中多媒体文件,则确定出所述预 置的多媒体库中不存在与所述检索关键词组相匹配的多媒体文件。即不需要计 算多媒体文件置信度, 该情况下, 不进行对多媒体文件的添加操作。
更进一步地, 请看参考图 4, 图 4为所述添加多媒体文件的方法的另一流 程示意图, 其中, 所述计算所述多媒体列表中多媒体文件的置信度(S104 )之 后, 还可以包括:
S 1041、 判断所述多媒体文件的置信度与预设可置信阔值;
S1041a、若多媒体文件的置信度大于或者等于所述预置可置信阔值, 则保 留所述多媒体文件;
S1041b、若多媒体文件的置信度小于所述预置可置信阔值,则将所述多媒 体文件从其所处的多媒体列表中删除。
可以理解的是, 步骤 S1041a或 S1041b后,将更新后的多媒体列表中多媒 体文件置信度最大的多媒体文件添加至文本。
优选地, 为了多媒体列表中置信度越高的多媒体文件的位置越靠前, 所述 计算所述多媒体列表中多媒体文件的置信度之后, 还可以包括:
按照多媒体文件的置信度由高到低,对多媒体列表中的多媒体文件进行排 序。
可以理解的是, 若对于两个置信度相同的多媒体文件, 可使用多媒体文件 的除检索关键词组中的主、从属性以外的属性辅助进行排序。 例如, 检索关键 词组 {吻别, 歌手: 刘德华 }检索出的两个置信度相同的多媒体文件 {吻别, 歌 手: 张学友 } (记为 a )和{吻别, 歌手: 黎明 } (记为 b )。 该情况下, 可以按 多媒体文件 a和多媒体文件 b的 "播放次数"、 "创建时间" 等属性进行排序, 此次不作具体限定。
由上述可知,本发明实施例提供的一种添加多媒体文件的方法具有以下优 点: 通过对字符文本进行词法、 句法和语义解析, 得到检索关键词组, 从而可 以知道文本的语义以及潜在意图;根据检索关键词检索与检索关键词组相匹配 的多媒体列表,并将多媒体列表中多媒体文件置信度最大的多媒体文件添加至 需要添加多媒体文件的文本, 从而使得添加的多媒体文件更符合上下文语境, 更准确, 简化了添加多媒体文件的操作, 提高用户体验。
为了更好地理解本发明技术方案, 下面以字符文本内容是"周杰伦的最新 单曲" 为例, 并结合图 1、 图 3a以及图 4所示的流程图, 对所述添加多媒体 文件的方法进行分析:
首先, 根据词库中的词典、 实体名词表、 同义词表, 对字符文本的内容进 行分词, 识别分词结果中的命名实体, 并对具有同义说法的词语进行标准化, 生成词法分析结果。 例如: "周杰伦的最新单曲" 的分词结果为 "周杰伦 //的 // 最新 //单曲" ( "//"表示分词结果词汇见的分隔符);命名实体识别的结果为 "周 杰伦-人名"; 同义词标准化的结果为 "单曲 歌曲"。 "周杰伦的最新单曲" 经 过词法分析模块的最终结果转换成 "周杰伦 I人名 //的 //最新 //歌曲"
其后, 对词法分析结果进行词性标注, 并依据词性标注结果, 结合自然语 言的语法, 分析并生成对应的语法分析树。词性标注结果与语法分析一起构成 了词法分析结果。 例如: "周杰伦 //的〃最新 //歌曲" 的词性标注结果为 "周杰 伦 I人名 //的 I结构助词 //最新 I形容词 //歌曲 I名词" ( Ί" 标志词语的词性注释); 可一并参考图 5, 图 5为该实施例中对应的语法分析树示意图。
进一步地, 分析词组本身的意义、 句法结构、 结合知识库中的推理规则, 解析句法分析结果中包含的文本语义及意图,输出供检索模块使用的检索关键 词组。 以句法分析结果数据 "周杰伦 I人名〃的 I结构助词 //最新 I形容词 //歌曲 I名 词"及图 5对应的语法树为例,首先确定字符文本的关键词,得到关键词表 {周 杰伦 I人名, 最新 I形容词, 歌曲 I名词 }。 同时结合语法分析树, 得到关键词之间 的主从、 修饰关系, "周杰伦" 和 "最新" 均作为歌曲的定语, 用于修饰歌曲。 于是, 可得到修饰关系为 {歌曲 周杰伦, 歌曲 最新 }。 然后结合知识库中的 推理规则库对关键词组及其修饰关系进行语义推理。 通过关键词 "歌曲"推理 得知检索的大类为 "音乐", 通过 "最新" 关键词, 推理关键词描述的是时间 属性。 最后, 结合语法分析树可得到 "周杰伦 I人名〃的 I结构助词〃最新 I形容词 //歌曲 I名词" 的文本语义为 "歌手是周杰伦的、 发售时间离当前时间最近的音 乐", 将其形式化描述为 {音乐, 歌手: 周杰伦, 发售时间: 最近 }。 其中, "音 乐" 为文本语义的主属性, "歌手: 周杰伦" 和 "发售时间: 最近" 为修饰主 属性 "音乐" 的从属性。 将这种形式化的描述(即检索关键词组)作为多媒体 检索模块的输入。
从多媒体库中检索与检索关键词组({音乐, 歌手: 周杰伦, 发售时间: 最近 } )相匹配的多媒体文件, 并计算多媒体文件的置信度。 首先, 多分类的 多媒体库以图 2b为例, 由检索关键词组中的主属性 "音乐" 可将检索的目标 对象定位到音乐多媒体库; 其次, 通过从属性 "歌手: 周杰伦" 可见检索对象 进一步缩小至关联到 "周杰伦" 节点音乐列表。 然后, 比较与 "周杰伦"相关 联的全部音乐的 "发售时间" 属性, 选择 "发售时间" 离当前时间最近的音乐 添加到相关多媒体列表。 最后,通过置信度计算公式计算该多媒体列表中的每 个多媒体文件的置信度。 多媒体文件的置信度计算公式可以为:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose 比较计算得到的多媒体列表中的每个多媒体文件的置信度与预置可置信 阔值的大小,如果计算出来的置信度小于预置可置信阔值, 则将该多媒体文件 从多媒体列表中移除。 经过该步骤的过滤后,得到更新后的可置信的多媒体列 表。
对可置信的相关多媒体列表中的多媒体文件进行排序,保证置信度越高的 多媒体文件的位置越靠前, 以得到排序后的可置信相关多媒体列表。其具体内 容为: 对于多媒体列表中的多媒体文件,按照其置信度由高到低对相关多媒体 进行排序。对于置信度相同的多媒体文件, 可使用多媒体文件的除检索关键词 组中的主、 从属性以外的属性辅助进行排序。 例如, 以多媒体文件的 "播放次 数"、 "创建时间" 等属性进行排序。
由上述可知,本发明实施例提供的一种添加多媒体文件的方法具有以下优 点: 通过对字符文本进行词法、 句法和语义解析, 得到检索关键词组, 从而可 以知道文本的语义以及潜在意图;根据检索关键词检索与检索关键词组相匹配 的多媒体列表,并将多媒体列表中多媒体文件置信度最大的多媒体文件添加至 需要添加多媒体文件的文本, 从而使得添加的多媒体文件更符合上下文语境, 更准确, 简化了添加多媒体文件的操作, 提高用户体验。
为便于更好的实施本发明实施例提供的添加多媒体文件的方法,本发明实 施例还提供一种基于上述添加多媒体文件的方法的设备。其中名词的含义与上 述添加多媒体文件的方法中相同, 具体实现细节可以参考方法实施例中的说 明。
请参考图 6, 图 6为本发明实施例提供的一种添加多媒体文件的设备 600 的结构示意图, 其中, 所述添加多媒体文件的设备 600可包括:
获取模块 601, 用于获取字符文本;
解析模块 602, 用于对所述字符文本进行解析, 得到检索关键词组; 检索模块 603, 用于根据所述检索关键词组, 在预置的多媒体库中检索与 所述检索关键词组相匹配的多媒体列表;
计算模块 604, 用于计算所述多媒体列表中多媒体文件的置信度; 添加模块 605, 用于若确定出所述多媒体列表中多媒体文件的置信度满足 预设条件时, 将置信度满足预设条件的多媒体文件添加至文本。
首先应该理解的是,所述添加多媒体文件的装置可基于语言解析系统中应 用, 该系统中可以包括知识库, 分类器以及多媒体库, 所述知识库, 分类器以 及多媒体库为预先预置。 其中, 所述知识库、 所述推理规则库、 所述分类器、 所述多媒体库可以参考对应方法实施例中的具体描述, 此处不作具体限定。
可选的, 本发明实施例中, 所述预设条件可以设定为多媒体文件的置信度 最高或者多媒体文件的置信度大于等于预设阔值等,在某些实施方式中, 若将 多媒体文件置信度最大确定为满足预设条件, 则所述添加模块 605具体用于: 在所述多媒体列表中获取到多媒体文件置信度最大的多媒体文件,并将所述多 媒体文件置信度最大的多媒体文件添加至文本, 容易想到的是, 此处举例并不 造成对本发明的限定。
进一步地, 在本发明一些实施例中, 所述解析模块 602, 可以具体包括: 第一解析单元, 用于对所述字符文本进行词法解析;
第二解析单元, 对词法解析得到的结果进行句法解析;
第三解析单元,对句法解析得到的结果进行语义解析,输出检索关键词组。 在某些实施例方式中, 所述第一解析单元, 可具体用于: 对所述字符文本 进行分词; 对分词后得到的词语、 词组、 短语进行命名实体识别; 根据预置同 义词组列表,将进行命名实体识别后得到的拥有多种同义表述的词语规范化为 同义词组的标准词, 所述标准词即为所述词法解析得到的结果。
可具体地, 可以将连续的字符文本按照语言中词语、 词组、 短语的概念、 注册、 关系、 属性等切分成词语、 词组、 或短语。 例如: "周杰伦的歌曲", 分 词结果输出 "周杰伦 //的 //歌曲"(其中 "//"表示词语间的分隔符); 识别词语、 词组、 或短语中的具有特定意义的实体, 主要包括人名、 地名等。 例如: "周 杰伦的东风破", 命名实体识别可输出 "周杰伦-人名", "东风破 -歌曲名"; 可 以理解的是, 所述预置同义词组列表中包括了多个同义词组合,每个同义词组 合由拥有多种同义表述的词语构成,并将这些拥有多种同义表述的词语规范化 为该同义词组合的标准词。 例如: "周杰伦、 周董、 Jay" 为一组同义词组, 其 中 "周杰伦" 为该同义词组的标准词, 如将字符文本 "周董的歌曲" 中的 "周 董" 规范化为 "周杰伦"。
所述第二解析单元从自然语言的语法层面,对字符文本进行解析, 在某些 实施方式中, 可具体用于: 对所述词法解析得到的结果进行词性标注; 对词性 标注后的输出结果进行分析, 得到输出结果中的词语、 词组之间的彼此主从、 修饰关系, 并生成对应的语法分析树。
可具体地, 给词法分析的输出结果中的每个词语、 词组、 短语指派一个合 适的词性。 例如, "周杰伦的歌曲" 经过词性标注的输出可以为 "周杰伦 I人名 //的 I结构助词 //歌曲 I名词", 其中 Ί" 后的内容表示前面单词的词性; 如图 3b 为字符文本为 "周杰伦的歌曲" 的例子中, 对应输出的语法分析树示意图。
在某些实施方式中, 所述第三解析单元, 可具体用于: 结合预置知识库, 对句法解析得到的词语、 词组之间的彼此主从、 修饰关系进行分析, 识别字符 文本的语义和意图, 并生成检索关键词组, 其中, 所述检索关键词组包括主属 性关键词组和从属性关键词组,所述从属性关键词组用于修饰所述主属性关键 词组表征的对象的属性。
可以理解的是, 语义解析通过分析词组本身的意义、 句法结构、 结合预置 知识库中的先验知识, 解析字符文本中涉及的实体、 关系、 主题、 意图等, 并 生成相关的检索关键词组。
所述检索关键词组可以包括主属性关键词组和从属性关键词组,所述从属 性关键词组用于修饰所述主属性关键词组表征的对象的属性。例如: 若检索关 键词组形如 "{东风破, 歌手: 周杰伦, 流派: 流行 }", 其中, "东风破" 为主 属性关键词组, "歌手: 周杰伦" 和 "流派: 流行" 为从属性关键词组, "周杰 伦" 表示了 "东风破" 的 "歌手" 属性。
其中, 可具体地, 进行语义解析提供的功能包括:
根据词法分析、 句法分析结果, 抽取字符文本中的关键词, 确定多个关键 词之间的主从、 修饰关系。 例如: "周杰伦的东风破", 依据词法分析中, 分词 和命名实体识别的结果, 可提取出关键词 "周杰伦" 和 "东风破", 然后依据 句法分析的句法分析树可知 "周杰伦" 作为 "东风破" 的定语, 用于修饰 "东 风破", 基于以上信息, 便可以获取关键词间的修饰关系: {东风破 周杰伦}; 其中, " " 表示修饰关系, 周杰伦作为东风破的一个属性值。
依据词法分析、 句法分析结果, 结合预置知识库, 进行语义推理, 识别字 符文本的潜在语义。 例如: "周杰伦的最新单曲", 经过词法分析生成 "周杰伦 //的 //最新 //单曲"; 经过句法分析生成 "周杰伦 I名词 //的 I结构助词 //最新 I形容词 〃单曲 I名词"; 依据知识库中的推理规则, 将 "单曲"推理到 "音乐", 将 "最 新" 推理到音乐的 "发售时间" 属性, 将周杰伦推理到音乐的 "歌手" 属性, 则可以得到 "周杰伦的最新单曲"全句的潜在语义为 "歌手是周杰伦的发售时 间距离当前时间最近的音乐", 对应的关键词组为 {音乐, 歌手: 周杰伦, 发售 时间: 最近 }。假如, 预置知识库中包含了两首音乐, 其详细信息为: {东风破, 发售时间: 2012-10-21, 歌手: 周杰伦 }和{青花瓷, 发售时间: 2013-11-30, 歌手: 周杰伦 }。 那么, 通过对两首歌的时间属性的比较, "青花瓷" 较 "东风 破" 推出晚, 是字符文本语义的目标多媒体文件。
依据词法分析、 句法分析结果, 结合预置知识库, 识别字符文本的潜在意 图。 例如: "今天的心情很失落", 依据知识库中的推理规则, 在图 2a描述的 多媒体分类树上, 4叚设节点 "伤感" 的关键词集合为{伤心, 失落, 糟糕 }, 当 字符文本为 "今天的心情很失落"时,首先可通过 "失落"关键词推理得到 "伤 感" 节点, 然后可沿 "伤感 音乐心情 音乐" 路径推理得到 "音乐" 节点。 即, "今天的心情很失落" 可以用 "音乐" 来描述。
需要说明的是, 所述语言解析系统中包括词库, 该词库保存了特定词语、 词组、 短语和指示其概念、 属性、 关系的实体之间的关联。 另外, 词库还可以 保存词语的同义词、 近义词, 实体名词等, 以结合多媒体库和知识库实现对字 符文本的解析。
更进一步地, 在本发明一些实施例中, 得到检索关键词组后, 根据所述检 索关键词组,在预置的多媒体库中检索与所述检索关键词组相匹配的多媒体列 表,其中与所述检索关键词组相匹配的多媒体列表的匹配关系可以包括全部命 中和部分命中,检索关键词组的主属性关键词组和从属性关键词组命中时可有 不同的权重值, 分别为 wprimary和 ^secondary , 本发明实施例中, 预先设定所述
Wprimary和所述 WseCondary的和为 1。 如果多媒体文件的描述中包含了检索关键词组中的某一关键词,则表示该 关键词命中, 反之该关键词未命中。 如: 关键词为 "周杰伦", 多媒体文件的 描述为 {东风破, 演唱者: 周杰伦 }, 那么关键词 "周杰伦" 命中。 所述检索关 键词组的 "命中率 (hit_ratio ),, 为命中的关键词个数占检索关键词组中全部 关键词个数的比值。 其具体计算分析过程如下:
一方面, 所述计算模块 604, 用于:
若所述检索关键词组中一个或多个关键词全部命中一个或多个多媒体文 件, 则将全部命中的多媒体文件标记为相关,且将所述全部命中的多媒体文件 的置信度设置为 1。 若所述检索关键词组中关键词全部命中多媒体文件, 则将 全部命中的多媒体文件标记为相关,且将所述全部命中的多媒体文件的置信度 设置为 1。 例如: 检索关键词组为{东风破 }, 多媒体库中的歌名为东风破的节 点唯一, 则{东风破, 歌手: 周杰伦, 流派: 流行 }节点被命中, 且关键词 "东 风破" 完全匹配, 所以将置信度确定为 1。 再如: 当检索关键词组为 {音乐, 歌手: 周杰伦 }时, 在多媒体分类树上, 检索到节点 "周杰伦", 且其所属的分 类为 "音乐" 大类下 "歌手" 子类, "周杰伦" 节点下包含了 "东风破"、 "双 截棍" 2个节点, 指示命中 2个多媒体文件; 该例子中, 关键词 "音乐" 与媒 体分类的大类 "音乐" 命中; 关键词 "歌手: 周杰伦" 与 "东风破" 和 "双截 棍" 2个节点的 "歌手: 周杰伦" 命中, 所以, 可以认为全部命中, 所以将置 信度确定为 1。
另一方面, 所述计算模块 604, 还可以用于:
若所述检索关键词组中一个或多个关键词部分命中一个或多个多媒体文 件, 则将部分命中的多媒体文件标记为相关, 且利用公式:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiosedary
计算所述部分命中的多媒体文件的置信度, 其中, 所述 confidence为所述 置信度, 所述 wprimary为所述主属性关键词组的权重值, 所述 wse∞ndary为所述从 属性关键词组的权重值, 所述 hit_ratioprimary为所述主属性关键词组的命中率, 所述 hit_ratiose∞ndary为所述从属性关键词组的命中率, 所述命中率为命中的关 键词个数占检索关键词组中全部关键词个数的比值。例如:检索关键词组为{吻 另1 J, 歌手: 周杰伦 }, 该检索关键词组种, 主属性关键词为 "吻别", 从属性关 键词为 "歌手: 周杰伦"。 其主属性关键词部分命中了节点 {吻别, 歌手: 张学 友, 音乐心情: 伤感、 浪漫 }, 命中率为 1, 从属关键词未命中, 所以, 该节 点的相关性置信度为: wprim£uy * 1 + wse∞nd£uy *0; 从属性关键词命中了 {东风破, 歌手:周杰伦,流派:流行 }节点,该节点的相关性置信度为 wprimary * 0 + wse∞ndary *1。
可以理解的是, 所述设备还可以包括确定模块, 所述确定模块用于: 若所述检索关键词组的任一关键词均未命中多媒体文件,则确定出所述预 置的多媒体库中不存在与所述检索关键词组相匹配的多媒体文件。即不需要计 算多媒体文件置信度, 该情况下, 不进行对多媒体文件的添加操作。
进一步地, 所述设备还可以包括判断模块, 所述判断模块用于: 判断所述 多媒体文件的置信度与预设可置信阔值;若多媒体文件的置信度大于或者等于 所述预置可置信阔值, 则保留所述多媒体文件; 若多媒体文件的置信度小于所 述预置可置信阔值, 则将所述多媒体文件从其所处的多媒体列表中删除。将更 新后的多媒体列表中多媒体文件置信度最大的多媒体文件添加至文本。
优选地, 为了多媒体列表中置信度越高的多媒体文件的位置越靠前, 所述 设备还可以包括排序模块, 所述排序模块用于: 在计算所述多媒体列表中多媒 体文件的置信度之后,按照多媒体文件的置信度由高到低,对多媒体列表中的 多媒体文件进行排序。
可以理解的是, 若对于两个置信度相同的多媒体文件, 可使用多媒体文件 的除检索关键词组中的主、从属性以外的属性辅助进行排序。 例如, 检索关键 词组 {吻别, 歌手: 刘德华 }检索出的两个置信度相同的多媒体文件 {吻别, 歌 手: 张学友 } (记为 a )和{吻别, 歌手: 黎明 } (记为 b )。 该情况下, 可以按 多媒体文件 a和多媒体文件 b的 "播放次数"、 "创建时间" 等属性进行排序, 此次不作具体限定。
由上述可知,本发明实施例提供的一种添加多媒体文件的装置具有以下优 点: 通过对字符文本进行词法、 句法和语义解析, 得到检索关键词组, 从而可 以知道文本的语义以及潜在意图;根据检索关键词检索与检索关键词组相匹配 的多媒体列表,并将多媒体列表中多媒体文件置信度最大的多媒体文件添加至 需要添加多媒体文件的文本, 从而使得添加的多媒体文件更符合上下文语境, 更准确, 简化了添加多媒体文件的操作, 提高用户体验。
请参考图 7, 图 7为本发明实施例提供的添加多媒体文件的设备的另一结 构示意图,本发明提供的添加多媒体文件的设备的系统架构包括但不限于一个 或者多个处理器、 内存、 对外接口、 输入设备、 输出设备、 存储设备和和至少 一个通信总线, 用于实现这些装置之间的连接通信等。
所述处理器可以是任意控制移动终端上的所有操作的设备,包括但不限于 执行短消息解析和服务、广告推荐时产生的指令。处理器可以是不限于一个或 者多个中央处理器( CPU, Central Processing Unit )、 GPU ( Graphic Processing Unit )、现场可编程逻辑门阵列( FPGA , Field Programmable Gate Array )、 DSP ( Digital Signal Processor )、专用集成电路( ASIC, Application Specific Integrated Circuit ), 可编程逻辑器件(PLD, Programmable Logic Device)等等, 或者是上 述设备的混合。
所述内存可以是任意緩存处理器执行移动终端上的操作所需要的数据和 指令序列的设备, 包括但不限于在运行短消息解析和服务、广告推荐所需要用 到的数据和指令序列。 内存可以是但不限于 RAM、 ROM, 闪存等等, 或者是 上述设备的混合。
所述对外接口可以是任意移动终端和外部设备或者网络进行交互的接口, 包括但不限于获取外部服务和广告信息所需要的接口。外部接口可以是但不限 于以太网接口、 DSL接口、 RF接口、 蓝牙等, 或者是上述接口的混合。 外部 接口上可以运行任意网络传输协议, 包括但不限于 USB、 电缆、 光纤、 无线 (包括但不限于 WiFi、 2G/3G/4G网络)等传输协议。
所述输入设备可以是任意移动终端获取用户输入和信息的设备。输入设备 可以是但不限于键盘、 鼠标、 触摸屏、 设备按键、 麦克风、 各种传感器 (如 GPS、 水平传感器、 重力传感器等等), 或者上述设备的混合。
所述输出设备可以是任意展示移动终端的处理结果的设备,包括但不限于 展示推荐的服务和广告。 输出设备可以是但不限于屏幕、 发声器、 耳机、 打印 机、 振动器等, 或者上述设备的混合。
存储设备可以是任意存储移动终端程序和数据的设备。存储设备包括但不 限于闪存、 硬盘、 CD-ROM等, 或者上述硬件的混合。
如图 7所示, 在一些实施方式中, 所述存储设备中存储了程序指令, 程序 指令可以被处理器执行, 所述处理器具体执行以下步骤:
获取字符文本; 对所述字符文本进行解析, 得到检索关键词组; 根据所述 检索关键词组,在预置的多媒体库中检索与所述检索关键词组相匹配的多媒体 列表; 计算所述多媒体列表中多媒体文件的置信度; 若确定出所述多媒体列表 中多媒体文件的置信度满足预设条件时,将置信度满足预设条件的多媒体文件 添力口至文本。
可选地, 所述处理器用于对所述字符文本进行解析,得到检索关键词组包 括: 对所述字符文本进行词法解析; 对词法解析得到的结果进行句法解析; 对 句法解析得到的结果进行语义解析, 输出检索关键词组。
可选地, 所述处理器用于对所述字符文本进行词法解析, 包括: 对所述字符文本进行分词; 对分词后得到的词语、 词组、 短语进行命名实 体识别; 根据预置同义词组列表, 将进行命名实体识别后得到的拥有多种同义 表述的词语规范化为同义词组的标准词,所述标准词即为所述词法解析得到的 结果。
可选地, 所述处理器用于对词法解析得到的结果进行句法解析, 包括: 对 所述词法解析得到的结果进行词性标注; 对词性标注后的输出结果进行分析, 得到输出结果中的词语、 词组之间的彼此主从、 修饰关系, 并生成对应的语法 分析树。
可选地, 所述处理器用于对句法解析得到的结果进行语义解析,输出检索 关键词组, 包括:
结合预置知识库, 对句法解析得到的词语、 词组之间的彼此主从、修饰关 系进行分析, 识别字符文本的语义和意图, 并生成检索关键词组, 其中, 所述 检索关键词组包括主属性关键词组和从属性关键词组,所述从属性关键词组用 于修饰所述主属性关键词组表征的对象的属性。
可选地, 所述处理器用于计算所述多媒体列表中多媒体文件的置信度, 包 括:
若所述检索关键词组中关键词全部命中多媒体文件,则将全部命中的多媒 体文件标记为相关, 且将所述全部命中的多媒体文件的置信度设置为 1 ;
若所述检索关键词组中关键词部分命中多媒体文件,则将部分命中的多媒 体文件标记为相关, 且利用公式:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose
计算所述部分命中的多媒体文件的置信度, 其中, 所述 confidence为所述 置信度, 所述 wprimary为所述主属性关键词组的权重值, 所述 wse∞ndary为所述从 属性关键词组的权重值, 所述 hit_ratioprimary为所述主属性关键词组的命中率, 所述 hit_ratiose∞ndary为所述从属性关键词组的命中率, 所述命中率为命中的关 键词个数占检索关键词组中全部关键词个数的比值。
可选地,所述处理器用于若确定出所述多媒体列表中多媒体文件的置信度 满足预设条件时, 将置信度满足预设条件的多媒体文件添加至文本, 包括: 将 多媒体文件置信度最大确定为满足预设条件,在所述多媒体列表中获取到多媒 体文件置信度最大的多媒体文件,并将所述多媒体文件置信度最大的多媒体文 件添力口至文本。
进一步可选地,所述处理器还用于若所述检索关键词组的任一关键词均未 命中多媒体文件,则确定出所述预置的多媒体库中不存在与所述检索关键词组 相匹配的多媒体文件。
进一步可选地,所述处理器计算所述多媒体列表中多媒体文件的置信度之 后, 还可以用于: 判断所述多媒体文件的置信度与预设可置信阔值; 若多媒体 文件的置信度大于或者等于所述预置可置信阔值, 则保留所述多媒体文件; 若 多媒体文件的置信度小于所述预置可置信阔值,则将所述多媒体文件从其所处 的多媒体列表中删除。
进一步可选地,所述处理器计算所述多媒体列表中多媒体文件的置信度之 后, 还可以用于: 按照多媒体文件的置信度由高到低, 对多媒体列表中的多媒 体文件进行排序。
由上述可知,本发明实施例提供的一种添加多媒体文件的装置具有以下优 点: 通过对字符文本进行词法、 句法和语义解析, 得到检索关键词组, 从而可 以知道文本的语义以及潜在意图;根据检索关键词检索与检索关键词组相匹配 的多媒体列表,并将多媒体列表中多媒体文件置信度最大的多媒体文件添加至 需要添加多媒体文件的文本, 从而使得添加的多媒体文件更符合上下文语境, 更准确, 简化了添加多媒体文件的操作, 提高用户体验。
在上述实施例中,对各个实施例的描述都各有侧重, 某个实施例中没有详 述的部分, 可以参见其他实施例的相关描述。
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述描述 的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统, 装置和方 法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性 的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另 外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或 一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直 接辆合或通信连接可以是通过一些接口, 装置或单元的间接辆合或通信连接, 可以是电性, 机械或其它的形式。 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部 单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元 中。上述集成的单元既可以釆用硬件的形式实现,也可以釆用软件功能单元的 形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发 明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全 部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储 介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前述 的存储介质包括: U盘、 移动硬盘、 只读存储器(ROM, Read-Only Memory ), 随机存取存储器(RAM, Random Access Memory ), 磁碟或者光盘等各种可以 存储程序代码的介质。
以上对本发明所提供的一种添加多媒体文件的方法及设备进行了详细介 绍, 对于本领域的一般技术人员, 依据本发明实施例的思想, 在具体实施方式 及应用范围上均会有改变之处, 综上所述, 本说明书内容不应理解为对本发明 的限制。

Claims

权 利 要 求
1、 一种添加多媒体文件的方法, 其特征在于, 包括:
获取字符文本;
对所述字符文本进行解析, 得到检索关键词组;
根据所述检索关键词组,在预置的多媒体库中检索与所述检索关键词组相 匹配的多媒体列表;
计算所述多媒体列表中多媒体文件的置信度;
若确定出所述多媒体列表中多媒体文件的置信度满足预设条件时,将置信 度满足预设条件的多媒体文件添加至文本。
2、 根据权利要求 1所述的方法, 其特征在于, 所述对所述字符文本进行 解析, 得到检索关键词组包括:
对所述字符文本进行词法解析;
对词法解析得到的结果进行句法解析;
对句法解析得到的结果进行语义解析, 输出检索关键词组。
3、 根据权利要求 2所述的方法, 其特征在于, 所述对所述字符文本进行 词法解析, 包括:
对所述字符文本进行分词;
对分词后得到的词语、 词组、 短语进行命名实体识别;
根据预置同义词组列表,将进行命名实体识别后得到的拥有多种同义表述 的词语规范化为同义词组的标准词, 所述标准词即为所述词法解析得到的结 果。
4、 根据权利要求 2或 3所述的方法, 其特征在于, 所述对词法解析得到 的结果进行句法解析, 包括:
对所述词法解析得到的结果进行词性标注;
对词性标注后的输出结果进行分析,得到输出结果中的词语、词组之间的 彼此主从、 修饰关系, 并生成对应的语法分析树。
5、 根据权利要求 2至 4任一项所述的方法, 其特征在于, 所述对句法解 析得到的结果进行语义解析, 输出检索关键词组, 包括:
结合预置知识库, 对句法解析得到的词语、 词组之间的彼此主从、修饰关 系进行分析, 识别字符文本的语义和意图, 并生成检索关键词组, 其中, 所述 检索关键词组包括主属性关键词组和从属性关键词组,所述从属性关键词组用 于修饰所述主属性关键词组表征的对象的属性。
6、 根据权利要求 5所述的方法, 其特征在于, 所述计算所述多媒体列表 中多媒体文件的置信度, 包括:
若所述检索关键词组中关键词全部命中多媒体文件,则将全部命中的多媒 体文件标记为相关, 且将所述全部命中的多媒体文件的置信度设置为 1 ;
若所述检索关键词组中关键词部分命中多媒体文件,则将部分命中的多媒 体文件标记为相关, 且利用公式:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose
计算所述部分命中的多媒体文件的置信度, 其中, 所述 confidence为所述 置信度, 所述 wprimary为所述主属性关键词组的权重值, 所述 wse∞ndary为所述从 属性关键词组的权重值, 所述 hit_ratioprimary为所述主属性关键词组的命中率, 所述 hit_ratiose∞ndary为所述从属性关键词组的命中率, 所述命中率为命中的关 键词个数占检索关键词组中全部关键词个数的比值。
7、 根据权利要求 1至 6任一项所述的方法, 其特征在于, 所述若确定出 所述多媒体列表中多媒体文件的置信度满足预设条件时,将置信度满足预设条 件的多媒体文件添加至文本, 包括:
将多媒体文件置信度最大确定为满足预设条件,在所述多媒体列表中获取 到多媒体文件置信度最大的多媒体文件,并将所述多媒体文件置信度最大的多 媒体文件添加至文本。
8、 根据权利要求 1至 7任一项所述的方法, 其特征在于, 所述方法还包 括:
若所述检索关键词组的任一关键词均未命中多媒体文件,则确定出所述预 置的多媒体库中不存在与所述检索关键词组相匹配的多媒体文件。
9、 根据权利要求 1至 7任一项所述的方法, 其特征在于, 所述计算所述 多媒体列表中多媒体文件的置信度之后, 包括:
判断所述多媒体文件的置信度与预设可置信阔值;
若多媒体文件的置信度大于或者等于所述预置可置信阔值,则保留所述多 媒体文件;
若多媒体文件的置信度小于所述预置可置信阔值,则将所述多媒体文件从 其所处的多媒体列表中删除。
10、 根据权利要求 1至 7任一项所述的方法, 其特征在于, 所述计算所述 多媒体列表中多媒体文件的置信度之后, 包括:
按照多媒体文件的置信度由高到低,对多媒体列表中的多媒体文件进行排 序。
11、 一种添加多媒体文件的设备, 其特征在于, 包括:
获取模块, 用于获取字符文本;
解析模块, 用于对所述字符文本进行解析, 得到检索关键词组;
检索模块, 用于根据所述检索关键词组,在预置的多媒体库中检索与所述 检索关键词组相匹配的多媒体列表;
计算模块, 用于计算所述多媒体列表中多媒体文件的置信度;
添加模块,用于若确定出所述多媒体列表中多媒体文件的置信度满足预设 条件时, 将置信度满足预设条件的多媒体文件添加至文本。
12、 根据权利要求 11所述的设备, 其特征在于, 所述解析模块, 包括: 第一解析单元, 用于对所述字符文本进行词法解析;
第二解析单元, 对词法解析得到的结果进行句法解析;
第三解析单元,对句法解析得到的结果进行语义解析,输出检索关键词组。
13、 根据权利要求 12所述的设备, 其特征在于, 所述第一解析单元, 具 体用于: 对所述字符文本进行分词; 对分词后得到的词语、 词组、 短语进行命 名实体识别; 根据预置同义词组列表,将进行命名实体识别后得到的拥有多种 同义表述的词语规范化为同义词组的标准词;所述标准词即为所述词法解析得 到的结果。
14、根据权利要求 12或 13所述的设备,其特征在于,所述第二解析单元, 具体用于: 对所述词法解析得到的结果进行词性标注; 对词性标注后的输出结 果进行分析, 得到输出结果中的词语、 词组之间的彼此主从、 修饰关系, 并生 成对应的语法分析树。
15、 根据权利要求 12至 14任一项所述的设备, 其特征在于, 所述第三解 析单元, 具体用于: 结合预置知识库, 对句法解析得到的词语、 词组之间的彼 此主从、 修饰关系进行分析, 识别字符文本的语义和意图, 并生成检索关键词 组, 其中, 所述检索关键词组包括主属性关键词组和从属性关键词组, 所述从 属性关键词组用于修饰所述主属性关键词组表征的对象的属性。
16、 根据权利要求 15所述的设备, 其特征在于, 所述计算模块, 具体用 于:
若所述检索关键词组中一个或多个关键词全部命中一个或多个多媒体文 件, 则将全部命中的多媒体文件标记为相关,且将所述全部命中的多媒体文件 的置信度设置为 1 ;
若所述检索关键词组中一个或多个关键词部分命中一个或多个多媒体文 件, 则将部分命中的多媒体文件标记为相关, 且利用公式:
confidence = wprimary * hit_ratioprimary + wsecondary * hit_ratiose
计算所述部分命中的多媒体文件的置信度, 其中, 所述 confidence为所述 置信度, 所述 wprimary为所述主属性关键词组的权重值, 所述 wse∞ndary为所述从 属性关键词组的权重值, 所述 hit_ratioprimary为所述主属性关键词组的命中率, 所述 hit_ratiose∞ndary为所述从属性关键词组的命中率, 所述命中率为命中的关 键词个数占检索关键词组中全部关键词个数的比值。
17、 根据权利要求 11至 16任一项所述的设备, 其特征在于, 所述添加模 块具体用于: 将多媒体文件置信度最大确定为满足预设条件,在所述多媒体列 表中获取到多媒体文件置信度最大的多媒体文件,并将所述多媒体文件置信度 最大的多媒体文件添加至文本。
18、 根据权利要求 11至 17任一项所述的装置, 其特征在于, 所述设备还 包括确定模块, 所述确定模块用于: 若所述检索关键词组的任一关键词均未命 中多媒体文件,则确定出所述预置的多媒体库中不存在与所述检索关键词组相 匹配的多媒体文件。
19、 根据权利要求 11至 17任一项所述的设备, 其特征在于, 所述设备还 包括判断模块, 所述判断模块用于: 判断所述多媒体文件的置信度与预设可置 信阔值; 若多媒体文件的置信度大于或者等于所述预置可置信阔值, 则保留所 述多媒体文件; 若多媒体文件的置信度小于所述预置可置信阔值, 则将所述多 媒体文件从其所处的多媒体列表中删除。
20、 根据权利要求 11至 17任一项所述的设备, 其特征在于, 所述设备还 包括排序模块, 所述排序模块用于: 按照多媒体文件的置信度由高到低, 对多 媒体列表中的多媒体文件进行排序。
PCT/CN2014/082691 2014-02-26 2014-07-22 一种添加多媒体文件的方法和设备 WO2015127747A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410067024.9A CN104866511B (zh) 2014-02-26 2014-02-26 一种添加多媒体文件的方法及设备
CN201410067024.9 2014-02-26

Publications (1)

Publication Number Publication Date
WO2015127747A1 true WO2015127747A1 (zh) 2015-09-03

Family

ID=53912346

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082691 WO2015127747A1 (zh) 2014-02-26 2014-07-22 一种添加多媒体文件的方法和设备

Country Status (2)

Country Link
CN (1) CN104866511B (zh)
WO (1) WO2015127747A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105893351B (zh) * 2016-03-31 2019-08-20 海信集团有限公司 语音识别方法及装置
CN108241668A (zh) * 2016-12-26 2018-07-03 北京搜狗科技发展有限公司 一种信息处理方法、装置及电子设备
CN108345608A (zh) * 2017-01-24 2018-07-31 北京搜狗科技发展有限公司 一种搜索方法、装置及设备
CN106953913A (zh) * 2017-03-20 2017-07-14 维沃移动通信有限公司 一种信息推送方法及移动终端
CN107527619B (zh) * 2017-08-29 2021-01-05 海信集团有限公司 语音控制业务的定位方法及装置
CN107729439A (zh) * 2017-09-29 2018-02-23 北京小米移动软件有限公司 获取多媒体数据的方法、装置和系统
CN108109620A (zh) * 2017-11-24 2018-06-01 北京物灵智能科技有限公司 一种机器人智能交互方法及系统
CN110430476B (zh) * 2019-08-05 2021-12-28 广州方硅信息技术有限公司 直播间搜索方法、系统、计算机设备和存储介质
CN110765759B (zh) * 2019-10-21 2023-05-19 普信恒业科技发展(北京)有限公司 意图识别方法及装置
CN111191459B (zh) * 2019-12-25 2023-12-12 医渡云(北京)技术有限公司 一种文本处理方法、装置、可读介质及电子设备
CN115981536A (zh) * 2020-09-04 2023-04-18 Oppo广东移动通信有限公司 多媒体数据的显示方法及装置、电子设备、存储介质
CN112257424A (zh) * 2020-09-29 2021-01-22 华为技术有限公司 一种关键词提取方法、装置、存储介质及设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030105589A1 (en) * 2001-11-30 2003-06-05 Wen-Yin Liu Media agent
US20060074898A1 (en) * 2004-07-30 2006-04-06 Marsal Gavalda System and method for improving the accuracy of audio searching
US20080201361A1 (en) * 2007-02-16 2008-08-21 Alexander Castro Targeted insertion of an audio - video advertising into a multimedia object
US20120316660A1 (en) * 2011-06-07 2012-12-13 Jiebo Luo Automatically selecting thematically representative music

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360358B (zh) * 2011-09-28 2016-08-17 百度在线网络技术(北京)有限公司 关键词推荐方法及系统
DE112012006050T5 (de) * 2012-03-19 2015-01-08 Mitsubishi Electric Corporation Bildschirmdatenerzeugungsvorrichtung für programmierbare Anzeigevorrichtung
CN103500235A (zh) * 2013-10-25 2014-01-08 乐视网信息技术(北京)股份有限公司 一种多媒体文件推荐方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030105589A1 (en) * 2001-11-30 2003-06-05 Wen-Yin Liu Media agent
US20060074898A1 (en) * 2004-07-30 2006-04-06 Marsal Gavalda System and method for improving the accuracy of audio searching
US20080201361A1 (en) * 2007-02-16 2008-08-21 Alexander Castro Targeted insertion of an audio - video advertising into a multimedia object
US20120316660A1 (en) * 2011-06-07 2012-12-13 Jiebo Luo Automatically selecting thematically representative music

Also Published As

Publication number Publication date
CN104866511B (zh) 2018-10-02
CN104866511A (zh) 2015-08-26

Similar Documents

Publication Publication Date Title
WO2015127747A1 (zh) 一种添加多媒体文件的方法和设备
US10210245B2 (en) Natural language question answering method and apparatus
US9406020B2 (en) System and method for natural language querying
US9448995B2 (en) Method and device for performing natural language searches
CN104252533B (zh) 搜索方法和搜索装置
US10073840B2 (en) Unsupervised relation detection model training
WO2017118427A1 (zh) 网页训练的方法和装置、搜索意图识别的方法和装置
US20150120738A1 (en) System and method for document classification based on semantic analysis of the document
WO2018201600A1 (zh) 信息挖掘方法、系统、电子装置及可读存储介质
JP2021111415A (ja) テキストテーマ生成方法、テキストテーマ生成装置、電子機器、記憶媒体およびコンピュータプログラム
US20180004838A1 (en) System and method for language sensitive contextual searching
US11488599B2 (en) Session message processing with generating responses based on node relationships within knowledge graphs
JP2009037603A (ja) クエリー要件展開器およびクエリー要件展開方法
WO2017107518A1 (zh) 一种解析语音内容的方法及装置
JP2009087339A (ja) オントロジーデータのインポート/エクスポートのための方法および装置
KR20150130214A (ko) 텍스트를 포함하는 문서 분류 및 분석 방법 및 이를 수행하는 문서 분류 및 분석 장치
US20180232461A1 (en) Search processing method and device
US20120317125A1 (en) Method and apparatus for identifier retrieval
Rodrigues et al. Advanced applications of natural language processing for performing information extraction
US20220365956A1 (en) Method and apparatus for generating patent summary information, and electronic device and medium
Singh et al. An efficient corpus-based stemmer
WO2012067586A1 (en) Database searching
US11281865B1 (en) Methods and systems for generating linguistic rules
CN113554172A (zh) 基于案例文本的裁判规则知识抽取方法及系统
JP2017201478A (ja) キーワード評価装置、類似度評価装置、検索装置、評価方法、検索方法、及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14883589

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14883589

Country of ref document: EP

Kind code of ref document: A1