WO2018049960A1 - 一种为文本信息匹配资源的方法及装置 - Google Patents

一种为文本信息匹配资源的方法及装置 Download PDF

Info

Publication number
WO2018049960A1
WO2018049960A1 PCT/CN2017/097611 CN2017097611W WO2018049960A1 WO 2018049960 A1 WO2018049960 A1 WO 2018049960A1 CN 2017097611 W CN2017097611 W CN 2017097611W WO 2018049960 A1 WO2018049960 A1 WO 2018049960A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
text
matching
tag
item
Prior art date
Application number
PCT/CN2017/097611
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 WO2018049960A1 publication Critical patent/WO2018049960A1/zh

Links

Images

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/48Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a method and apparatus for matching resources for text information.
  • ⁇ олователи will record a variety of information through various network platforms, such as recording information about daily life. Similarly, users will also generate information when communicating with other users through the communication platform.
  • a static text is automatically converted into a lively and interesting animation by acquiring the above user information and identifying and transforming the information.
  • the existing practice is usually to set a certain keyword for each resource by keyword matching method, and after the user inputs a series of words, the user input words are synonymized. Obtain a query word list (query list), and then query according to the query word list to obtain the corresponding query result.
  • query word list query word list
  • Expanding synonyms may cause deviations in the original meaning of words, and it is not good to deal with negatives and negatives to negate such relationships.
  • the words in the query word list are matched with the keywords of the resource, and only the words that are completely consistent are recognized as matching, and thus may be synonymous
  • the word expansion is not enough or the meaning is biased and the matching resources cannot be found.
  • the embodiment of the present application provides a method for matching resources for text information, and aims to more accurately and comprehensively determine resources that match the text information according to the characteristics of the text information, and meet the diversified needs of the user for the expression form.
  • the embodiment of the present application further provides a device for matching resources with text information, and aims to more accurately and comprehensively determine resources that match the text information according to the characteristics of the text information, and meet the diversified needs of the user for the expression form.
  • determining the similarity between the text keyword and the resource tag includes:
  • obtaining the word vector in the word vector library includes:
  • each element in the word vector represents the frequency of occurrence of the corresponding participle and/or the co-occurrence frequency with other participles.
  • determining, according to the similarity between the text keyword and the resource tag, the resource that matches the text information including:
  • the preset resource tags with the highest similarity are output to determine resources that match the text information.
  • determining, according to the similarity between the text keyword and the resource tag, the resource that matches the text information including:
  • calculating a matching degree between the text keyword and the resource item including:
  • determining, according to the matching degree of the text keyword and each of the resource items, the resource that matches the text information including:
  • the most matching preset resource items are output to determine resources that match the textual information.
  • the most matched preset resource items are output to determine resources that match the text information, specifically:
  • the resource corresponding to the resource item selected by the user in the candidate resource item is determined as a resource that matches the text information.
  • the determining of the weight of the resource tag in the belonging resource item includes:
  • the method further includes:
  • usage information of the user includes historical preference information of the user, personal information, and/or tag information of a similar user;
  • the method further includes:
  • acquiring text keywords according to the text information includes:
  • the text information is segmented to obtain the text keyword.
  • the categories of the resources include a picture, a photo, a music, a voice, a sound effect, an action, an expression, an animation, and/or a video.
  • An obtaining module configured to obtain a text keyword according to the text information
  • a matching module configured to determine, according to the similarity between the text keyword and the resource tag, a resource that matches the text information; wherein the resource tag corresponds to the resource.
  • the matching module includes:
  • a calculation module configured to calculate a matching degree between the text keyword and the resource item according to a similarity between the text keyword and the resource tag, and a weight of a corresponding resource tag in a resource item;
  • the resource item includes at least one of the resource tags;
  • a resource determining module configured to determine, according to a matching degree of the text keyword and each of the resource items, a resource that matches the text information, where the resource item includes at least one of the resources.
  • the text keyword obtained according to the text information can express the characteristics of the text information
  • the resource tag can express the characteristics of the resource
  • the text keyword and the resource tag are all extracted through the text information or the resource itself, and no similarity is performed. There are steps in the technique to extend synonyms, so there is no intentional deviation and the resulting matching results are more accurate.
  • FIG. 1 is a schematic flowchart of a method for matching resources of text information in an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a second method for matching resources of text information in the embodiment of the present application
  • FIG. 3 is a schematic flowchart of a third method for matching resources with text information in the embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an apparatus for matching resources of text information in an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an apparatus for matching text resources according to a second embodiment of the present application.
  • categories of resources include pictures, photos, music, voice, sound effects, actions, emoticons, animations, and/or videos.
  • Figure 1 shows a flow diagram of a method for matching resources for text information, including:
  • S102 Determine, according to the similarity between the text keyword and the resource tag, a resource that matches the text information, where the resource tag corresponds to the resource.
  • the text keyword obtained by using the text information represents the feature of the text information
  • the resource tag is used to display the characteristics of the resource
  • the text keyword and the resource tag are all through the text information.
  • the resources themselves are extracted, and there is no step similar to the expansion of synonyms in the prior art. Therefore, there is no intentional deviation, and the obtained matching result is more accurate.
  • the concept of similarity is introduced in the foregoing embodiment, and the degree of matching between the text information and the resource is reflected by the similarity between the text keyword and the resource tag, so that the matching cannot be found in the prior art because the completely identical keyword cannot be found. The problem of resources.
  • the above step S101 obtains a text keyword according to the text information, which may be specifically: first obtaining the text information; and then segmenting the text information to obtain the text keyword.
  • the words of modern Chinese can be divided into 12 categories according to their part of speech.
  • Real words include nouns, verbs, adjectives, numerals, quantifiers and pronouns.
  • Function words include adverbs, prepositions, conjunctions, auxiliary words, interjections, and onomatopoeia.
  • the similarity between the text keyword and the resource tag according to the step S102 is performed, and the determining process may include:
  • each word segmentation in the word list Get its word vector (ie the first word vector), recorded as Indicates the number of text keywords corresponding to the text information, that is, the number of words in the word list.
  • the word vector of the resource tag ie, the second word vector
  • t k represents the kth resource tag
  • K represents the total number of resource tags.
  • the word vector can specifically include:
  • each element in the word vector represents the frequency of occurrence of the corresponding participle and/or with other participles The frequency of the co-occurrence.
  • Training corpus for training word vectors can come from a variety of sources, such as web page text crawled from web pages using web crawlers. Before the wording of the training corpus, it is also possible to perform the preprocessing of the case conversion to lowercase, invalid characters to spaces, deletion of spaces between Chinese characters, and conversion of Traditional Chinese to Simplified Chinese. On the basis of preprocessing, after the process of word segmentation, de-duplication, part-of-speech screening, etc., the word segmentation set is obtained, then the frequency and/or frequency of occurrence of each word segment in the word segmentation set, and the frequency of co-occurrence with other word segments in the same sentence.
  • the order of the components in the word vector is not particularly limited as long as the word vectors of the respective word segments correspond to the respective components. The following is an example of the detailed process of obtaining a word vector.
  • Corpus 2 The dumplings of the Dragon Boat Festival are delicious.
  • Corpus 3 The custom of the Dragon Boat Festival is to eat dumplings and dragon boat races.
  • the components of the word vector of each participle constitute the rule (the frequency of occurrence of the participle, the co-occurrence of the participle and the first participle, the co-occurrence of the participle and the second participle, the co-occurrence of the participle and the nth part)
  • the word vector of the word "Dragon Boat Festival” can be expressed as: (1,3,1,2,1,1,1,1,1)
  • the first component "1" indicates that the probability of occurrence of three corpora in the training corpus of "Dragon Boat Festival" is 100%;
  • the second component "3" indicates that the "Dragon Boat Festival” appears three times in the training corpus (the participle "Dragon Boat Festival” is the first participle, and this also indicates the total number of occurrences of the participle "Dragon Boat Festival” in the training corpus) ;
  • the third component "1" indicates that the "Dragon Boat Festival” and the participle “Happy” have appeared together once (in the first corpus);
  • the fourth component "2" indicates that the "Dragon Boat Festival" and the participle "Xunzi” appear together twice (in corpus two and corpus three);
  • the fifth component "1" indicates that the "Dragon Boat Festival” and the word “good” have appeared together once (in the second corpus);
  • the sixth component "1" indicates that the "Dragon Boat Festival" and the participle "custom” have appeared together once (in the third corpus);
  • the seventh component “1” means that the “Dragon Boat Festival” and the word “eat” appear together once (in the third corpus);
  • the eighth component "1" indicates that the “Dragon Boat Festival” and the word “race” have appeared together once (in the third corpus);
  • the ninth component "1" indicates that the "Dragon Boat Festival” and the participle "Dragon Boat” have appeared together once (in the third corpus).
  • the word vector of each word can be obtained, and then the similarity between the text keyword and the resource tag can be calculated, so that the text keyword can be similar to the resource tag.
  • the preset resource tag with the highest similarity is output to determine the resource that matches the text information.
  • a high degree of similarity indicates that the text keyword of the text information is very similar to the resource tag, and the association is strong. Therefore, the resource corresponding to the resource tag can be determined as a resource that matches the text information, so that the matched resource can be used. Diversified representation of the content of textual information to meet the diverse needs of users in the form of expression.
  • the text keyword is obtained according to the text information
  • the step S102 determines the resource that matches the text information according to the similarity between the text keyword and the resource tag, which may specifically include, as shown in FIG. 2 Shown as follows:
  • S1021 Calculate a matching degree between the text keyword and the resource item according to the similarity between the text keyword and the resource tag, and the weight of the corresponding resource tag in the belonging resource item; wherein the resource item includes at least one resource tag;
  • S1022 Determine, according to a degree of matching between the text keyword and each resource item, a resource that matches the text information, where the resource item includes at least one resource.
  • the similarity between the text keyword and the resource tag is obtained in the same manner as in the first embodiment, and details are not described herein again.
  • each resource tag has different degrees of association with the corresponding resources.
  • an animation of a birthday candle on a birthday cake can be characterized by the resource labels "birthday”, “cake”, “happy”, “blessing”, etc.
  • “birthday” and this animation The relevance is the greatest, while the "blessing” is the least relevant. Therefore, in the embodiment shown in FIG. 2, the resources corresponding to the same resource are used.
  • the collection of source tags is called a resource item, so that the concept of the weight of the resource tag in the belonging resource item is introduced, and the similarity between the text keyword and the resource tag is combined to calculate the matching degree between the text keyword and the resource item, and then Based on this, resources that match the text information are determined, thereby facilitating accurate and comprehensive determination of resources that match the text information.
  • the cosine similarity of the word vector of the text key w j and the word vector of the resource tag t k is calculated by the following formula:
  • calculating a sum of products of similarity and weight that is, calculating a weighted sum of similarity between the text keyword and the resource tag according to the weight of the corresponding resource tag in the belonging resource item, as a text keyword and corresponding The degree of matching of the resource item to which the resource tag belongs.
  • the degree of matching text keywords and resource item w j is denoted by T n S jn, is calculated according to the formula S jn:
  • the matching degree of the text keyword and the resource item may be further sorted, and the most matching preset resource items are output to determine the resource that matches the text information.
  • the resource item with the highest matching degree that is, the value of S jn is the largest
  • the resource corresponding to the resource item is determined as The resource information matches the resource; the most matching preset resource item may be output as an alternative resource item for the user to select; the resource corresponding to the resource item selected by the user in the candidate resource item is determined as A resource that matches the text information.
  • the determination of the weight of the resource tag in the belonging resource item may include the following process:
  • this initial value can be set according to the result of experience or machine learning, or the same weight can be set for each resource tag (assuming there is a resource item) K resource tags, the initial weight of each resource tag can be set to ).
  • the resource label in the resource item y and/or the adjustment resource label may be adjusted according to the resource item y selected by the user and the text information input by the user.
  • the weight in the resource item y Specifically, the text keyword that matches the resource item y in the text information input by the user may be first found. That is, find the text keyword with the highest matching degree with the resource item y. Satisfy: If text keyword Already in the resource tag included in the resource item y, the weight of the resource tag in the resource item y is updated (the manner of updating may be to increase the weight of the resource tag), otherwise the text keyword is As a new resource tag is added to the resource item y.
  • the initial weight can be set to Coming soon text keywords The degree of matching with the original resource item y As a new resource tag Initial weight in the new resource item y; text keywords can also be calculated The sum of the similarities with the resource tags in the original resource item y as the newly added resource tag The initial weight in the new resource item y. Further, the resource items in which the weighted resource tags are updated are weighted and normalized.
  • the user may directly determine whether the resource item selected by the user includes Is there exactly the same as the text keyword. If the user selected the resource The item contains a resource label that is identical to the text keyword (equivalent to the highest similarity between the resource label and the text keyword), and the weight of the resource label can be increased; if the resource item selected by the user is not The resource tag that is completely consistent with the text keyword can be added to the resource item as a resource tag, and the weight can be set accordingly.
  • the weight of each resource label in the resource item may be further normalized, that is, adjusted according to the original ratio, so that The sum of the weights of the resource tags remains at 1.
  • the user's usage information may be acquired in step S103.
  • the usage information includes the user's historical preference information, personal information, and/or tag information of the same type of user.
  • step S1021 is performed to calculate the matching degree between the text keyword and the resource item, before performing the step S1022, according to the matching degree between the text keyword and each resource item, and determining the resource matching the text information
  • step S104 is further performed according to the user usage information. Adjust the matching degree between the text keyword and the resource item to obtain the updated matching degree.
  • the user's historical preference information, the user's personal information (such as age, gender, region, etc.), and the tag information of similar users may reflect the user's preference for resources. Therefore, the degree of matching between the text keyword and the resource item is adjusted according to the usage information. For example, the matching degree of the resource item closely related to the usage information of the user may be enlarged, and the coefficient multiplied by 1 or increased by a certain amount may be used. Numerical values, etc.; for example, the degree of matching of resource items that are weakly associated with the user's usage information can be reduced. Sort the adjusted matching degree, and then recommend the personalized information to the user or directly recommend the resource item with the highest matching degree to the user.
  • execution bodies of the steps of the methods provided in Embodiments 1 to 3 may all be the same device, or the method may also be performed by different devices.
  • the application also provides an apparatus 100 for matching resources for text information, as shown in FIG. 4, including:
  • the obtaining module 101 is configured to obtain a text keyword according to the text information
  • the matching module 102 is configured to determine, according to the similarity between the text keyword and the resource tag, a resource that matches the text information, where the resource tag corresponds to the resource.
  • the foregoing matching module 102 may further include:
  • the calculation module 1021 is configured to calculate a matching degree between the text keyword and the resource item according to the similarity between the text keyword and the resource tag, and the weight of the corresponding resource tag in the belonging resource item; wherein the resource item includes at least one Resource label
  • the resource determining module 1022 is configured to determine, according to the matching degree of the text keyword and each resource item, a resource that matches the text information, where the resource item includes at least one resource.
  • the apparatus for the text information matching resource provided in this embodiment corresponds to the methods described in Embodiments 1 to 3, and details are not described herein again.
  • T 1 Happy birthday! (Resource tags and their weights are: Cake 0.2, Song 0.15, Birthday 0.5, Happy 0.15)
  • T 4 Happy Mid-Autumn Festival (resource label and its weight are: moon cake 0.6, reunion 0.3, happy 0.1)
  • Each resource item contains at least one piece of music resources corresponding to the resource item.
  • the resource items are sorted according to the order of matching from high to low, and the following are obtained: T2, T3, T1, T4.
  • the resource items may be reordered in consideration of attributes such as a user's history, personal area/gender, and the like.
  • the reordered resource items are: T 3 , T 2 , T 1 , T 4 .
  • the weight of the "Dragon Boat Festival” in T 3 can be increased. If the user clicks on T 2 , the label “Dragon Boat Festival” can be added to the resource tag of T 2 . If the user selects T 1 or T 4 , the weight of the corresponding resource tag “happy” is added to the corresponding resource item.
  • embodiments of the present invention may be provided as a method, system, or Computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory (flash) RAM). Memory is an example of a computer readable medium.
  • RAM random access memory
  • ROM read only memory
  • flash flash memory
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information 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

一种为文本信息匹配资源的方法及装置
本申请要求于2016年9月14日提交中国专利局、申请号为201610824080.1、发明名称为“一种为文本信息匹配资源的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种为文本信息匹配资源的方法及装置。
背景技术
用户会通过各种网络平台记录各种各样的信息,例如记录日常生活的信息,同样,用户也会通过通信平台产生其与其他用户进行通信时的信息。本方法中,通过获取上述用户信息,并对信息进行识别转化,将一段静态的文字自动转化成生动有趣的动画。
随着互联网技术的发展,各种多媒体资源日益丰富,各类信息的表现形式也更加灵活、生动、有趣。在用户的实际应用中,有时希望将文本信息采用更多样化的形式展示出来,这就需要找到与这些文本信息相匹配的多媒体资源。例如,发送“祝你生日快乐”的祝福时,可以采用插上蜡烛的生日蛋糕的图片、动画和/或音乐表现,因此,需要依据“祝你生日快乐”的文本信息寻找到与之相匹配的图片、动画和/或音乐。
为了为文本信息找到相匹配的资源,现有的做法通常是通过关键词匹配的方法,为每个资源设定一定的关键词,在用户输入一系列词语之后,将用户输入的词语进行同义词扩展,获得查询词列表(Query词列表),再根据查询词列表进行查询,获得对应的查询结果。现有技术的缺点在于:
(1)扩展同义词可能使得词语的原本意思出现偏差,而且不好处理否定、以及否定的否定这种关系。
(2)在根据查询词列表进行查询时,将查询词列表中的词语与资源的关键词进行匹配,只有完全一致的词语才认定为相匹配,从而可能会因为同义 词扩展不够或含义偏差而无法找到相匹配的资源。
发明内容
本申请实施例提供一种为文本信息匹配资源的方法,目的在于依据文本信息的特征,更准确、更全面地确定与该文本信息相匹配的资源,满足用户对表现形式的多样化需求。
本申请实施例还提供一种为文本信息匹配资源的装置,目的在于依据文本信息的特征,更准确、更全面地确定与该文本信息相匹配的资源,满足用户对表现形式的多样化需求。
本申请实施例采用下述技术方案:
本申请实施例提供的一种为文本信息匹配资源的方法,包括:
依据所述文本信息,获取文本关键字;
依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源;其中,所述资源标签与所述资源相对应。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,所述文本关键字与资源标签的相似度的确定包括:
从词向量库中分别获取所述文本关键字的第一词向量和所述资源标签的第二词向量;所述词向量库中包含至少一个分词的词向量;
计算所述第一词向量与所述第二词向量的余弦相似度,作为所述文本关键字与所述资源标签的相似度。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,所述词向量库中词向量的获得包括:
获取用于训练词向量的训练语料;
对所述训练语料进行分词,获得分词集合;
依据所述分词集合中各分词的出现频次和/或与其他分词的共现关系,确 定各分词的词向量;所述词向量中每一个元素表示对应分词的出现频次和/或与其他分词的共现频次。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源,包括:
对所述文本关键字与所述资源标签的相似度进行排序;
将相似度最高的预设个资源标签输出,用以确定与所述文本信息相匹配的资源。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源,包括:
依据所述文本关键字与所述资源标签的相似度、以及相对应的资源标签在所属资源项中的权重,计算所述文本关键字与所述资源项的匹配程度;其中,所述资源项中包含至少一个所述资源标签;
依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源;其中,所述资源项中包含至少一个所述资源。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,计算所述文本关键字与所述资源项的匹配程度,包括:
计算所述相似度与所述权重的乘积之和,作为所述文本关键字与相对应的资源标签所属资源项的匹配程度。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源,包括:
对所述文本关键字与所述资源项的匹配程度进行排序;
将最匹配的预设个资源项输出,用以确定与所述文本信息相匹配的资源。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,将最匹配的预设个资源项输出,用以确定与所述文本信息相匹配的资源,具体为:
将最匹配的预设个资源项输出,作为备选资源项向用户推荐;
将用户在所述备选资源项中选取的资源项所对应的资源确定为与所述文本信息相匹配的资源。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,所述资源标签在所属资源项中的权重的确定包括:
对所述资源标签在所属资源项中的权重设定初始值;
依据用户在所述备选资源项中选取的资源项,调整所述资源项中的资源标签和/或调整资源标签在所属资源项中的权重。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,所述方法还包括:
获取用户的使用信息,所述使用信息包括用户的历史偏好信息、个人信息和/或同类用户的标签信息;
则在计算所述文本关键字与所述资源项的匹配程度之后,在依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源之前,还包括:
依据用户的所述使用信息,对所述文本关键字与所述资源项的匹配程度进行调整,得到更新后的匹配程度。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,依据所述文本信息,获取文本关键字,包括:
获取所述文本信息;
对所述文本信息进行分词,得到所述文本关键字。
可选地,本申请实施例提供的为文本信息匹配资源的方法中,所述资源的类别包括图片、照片、音乐、语音、音效、动作、表情、动画和/或视频。
本申请实施例提供的一种为文本信息匹配资源的装置,包括:
获取模块,用于依据所述文本信息,获取文本关键字;
匹配模块,用于依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源;其中,所述资源标签与所述资源相对应。
可选地,本申请实施例提供的为文本信息匹配资源的装置中,所述匹配模块包括:
计算模块,用于依据所述文本关键字与所述资源标签的相似度、以及相对应的资源标签在所属资源项中的权重,计算所述文本关键字与所述资源项的匹配程度;其中,所述资源项中包含至少一个所述资源标签;
资源确定模块,用于依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源;其中,所述资源项中包含至少一个所述资源。
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:
(1)依据文本信息获取的文本关键字可以表现出文本信息的特征,资源标签能表现出资源的特征,文本关键字和资源标签都是通过文本信息或资源本身提炼出来的,没有进行类似现有技术中扩展同义词的步骤,因此,不会出现意思偏差,得到的匹配结果更加准确。
(2)引入相似度的概念,通过文本关键字与资源标签的相似度体现文本信息与资源的匹配程度,避免了现有技术中由于无法找到完全一致的关键词而无法找到相匹配的资源的问题。
(3)通过训练语料对词语之间的相似度进行计算,并从词语自身的出现频次和/或在同一语句中与其他词语的共现关系的角度考虑词语之间的相似度,能更全面、更准确的体现词语之间语义上的相似性,而不限于文字上的相似性。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部 分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本申请实施例中为文本信息匹配资源的方法的流程示意图;
图2为本申请实施例中第二种为文本信息匹配资源的方法的流程示意图;
图3为本申请实施例中第三种为文本信息匹配资源的方法的流程示意图;
图4为本申请实施例中为文本信息匹配资源的装置的结构示意图;
图5为本申请实施例中第二种为文本信息匹配资源的装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图,详细说明本申请各实施例提供的技术方案。
在本申请的各实施例中,资源的类别包括图片、照片、音乐、语音、音效、动作、表情、动画和/或视频。
实施例1
图1给出了一种为文本信息匹配资源的方法的流程示意图,包括:
S101:依据文本信息,获取文本关键字;
S102:依据文本关键字与资源标签的相似度,确定与文本信息相匹配的资源;其中,资源标签与资源相对应。
上述实施例中,采用文本信息获取的文本关键字表现出文本信息的特征,采用资源标签表现出资源的特征,文本关键字和资源标签都是通过文本信息 或资源本身提炼出来的,没有进行类似现有技术中扩展同义词的步骤,因此,不会出现意思偏差,得到的匹配结果更加准确。另外,上述实施例中引入相似度的概念,通过文本关键字与资源标签的相似度体现文本信息与资源的匹配程度,避免了现有技术中由于无法找到完全一致的关键词而无法找到相匹配的资源的问题。
上述步骤S101依据文本信息,获取文本关键字,可具体为:先获取文本信息;再对文本信息进行分词,得到文本关键字。
获取文本信息的方法有很多,可以由用户直接输入,也可以由用户导入的文本转化得到。对文本信息进行分词时,采用常用的分词算法即可,此处不作限定。
获取到用户输入的文本信息后,进行分词并筛选特定词性的词语,形成J个词的词列表,记为w={w1,w2,w3,...wJ}。现代汉语的词语按照词性可以分为12类。实词包括名词、动词、形容词、数词、量词和代词。虚词包括副词、介词、连词、助词、叹词、拟声词。在形成词列表w时,将虚词筛除,将实词进行切分,得到w1、w2、w3等分词。
上述图1所示实施例中,执行步骤S102时所依据的文本关键字与资源标签的相似度,其确定过程可包括:
从词向量库中分别获取文本关键字的第一词向量和资源标签的第二词向量;词向量库中包含至少一个分词的词向量;
计算第一词向量与第二词向量的余弦相似度,作为文本关键字与资源标签的相似度。
依据对文本信息进行分词得到的词列表w={w1,w2,w3,...wJ},对该词列表中的每一个分词
Figure PCTCN2017097611-appb-000001
获取其词向量(即第一词向量),记为
Figure PCTCN2017097611-appb-000002
表示文本信息对应的文本关键字的数量,即词列表中词 语的数量。资源标签的词向量(即第二词向量)记为vec(tk),k=1,2,3,...K,tk表示第k个资源标签,K表示资源标签的总数量。则文本关键字wj的词向量与资源标签tk的词向量的余弦相似度采用以下公式计算:
simjk=cos(vec(wj),vec(tk))(其中,j=1,2,3,...J,k=1,2,3,...K)
获取词向量有多种方法,例如可以采用Google公司在2013年开放的一款用于训练词向量的word2vec工具,也可以采用GloVe算法进行词向量的训练,还可以采用以下方式获得词向量库中的词向量,具体可包括:
获取用于训练词向量的训练语料;
对所述训练语料进行分词,获得分词集合;
依据所述分词集合中各分词的出现频次和/或与其他分词的共现关系,确定各分词的词向量;所述词向量中每一个元素表示对应分词的出现频次和/或与其他分词的共现频次。
用于训练词向量的训练语料可以有多种来源,例如采用网页爬虫从网页上抓取的网页文本等。对训练语料进行分词前,还可以进行大小写统一转换为小写、无效字符转换为空格、删除中文字符之间的空格、繁体中文转换为简体中文等方面的预处理。在预处理的基础上,经过分词、去重、词性筛选等过程后获得分词集合,然后对分词集合中各分词的出现频率和/或次数、以及与其他分词在同一句话中共同出现的频率和/或次数进行统计,将统计得到的结果作为该分词的词向量中的分量,构成该分词的词向量。各分量在词向量中的顺序无需特别限定,只要各分词的词向量在各分量上相对应即可。以下举例说明获取词向量的详细过程。
假设有三条训练语料:
语料一:端午节快乐!
语料二:端午节的粽子好吃。
语料三:端午节的习俗有吃粽子和赛龙舟。
对于以上语料进行分词,得到分词集合:
{端午节;快乐;粽子;好吃;习俗;吃;赛;龙舟}
假设各分词的词向量的分量构成规则为(分词出现的频率,分词与第一分词的共现次数,分词与第二分词的共现次数···,分词与第n分词的共现次数),以获取“端午节”的词向量为例,则分词“端午节”的词向量可表示为:(1,3,1,2,1,1,1,1,1)
第一分量“1”表示“端午节”在训练语料中三条语料出现的概率为100%;
第二分量“3”表示“端午节”在训练语料中出现了3次(分词“端午节”即为第一分词,此时亦可表示分词“端午节”在训练语料中出现的总次数);
第三分量“1”表示“端午节”与分词“快乐”共同出现了1次(在语料一中);
第四分量“2”表示“端午节”与分词“粽子”共同出现了2次(在语料二和语料三中);
第五分量“1”表示“端午节”与分词“好吃”共同出现了1次(在语料二中);
第六分量“1”表示“端午节”与分词“习俗”共同出现了1次(在语料三中);
第七分量“1”表示“端午节”与分词“吃”共同出现了1次(在语料三中);
第八分量“1”表示“端午节”与分词“赛”共同出现了1次(在语料三中);
第九分量“1”表示“端午节”与分词“龙舟”共同出现了1次(在语料三中)。
采用以上示例的方法,可以取得各词语的词向量,进而可以计算得到文本关键字与资源标签的相似度,从而可以依据文本关键字与资源标签的相似 度,确定与文本信息相匹配的资源,具体可包括:
对文本关键字与资源标签的相似度进行排序;
将相似度最高的预设个资源标签输出,用以确定与文本信息相匹配的资源。
相似度高表示文本信息的文本关键字与资源标签非常相似,关联性强,因此,可以将与该资源标签相对应的资源确定为与文本信息相匹配的资源,从而可以用相匹配的资源来多样化地表现文本信息的内容,满足用户对表现形式的多样化需求。
实施例2
在实施例1的基础上,执行步骤S101依据文本信息,获取文本关键字之后,步骤S102依据文本关键字与资源标签的相似度,确定与文本信息相匹配的资源,可以具体包括,参见图2所示:
S1021:依据文本关键字与资源标签的相似度、以及相对应的资源标签在所属资源项中的权重,计算文本关键字与资源项的匹配程度;其中,资源项中包含至少一个资源标签;
S1022:依据文本关键字与各资源项的匹配程度,确定与文本信息相匹配的资源;其中,资源项中包含至少一个资源。
在实施例2中,文本关键字与资源标签的相似度的获取方式与实施例1相同,在此不再赘述。
对于同一资源而言,可能具有多方面的特征,从而可以用多个资源标签来表征,而每一个资源标签与相应资源的关联度不尽相同。例如,一段生日蛋糕上点燃生日蜡烛的动画,可以用资源标签“生日”、“蛋糕”、“快乐”、“祝福”等来表征,在这几个资源标签中,“生日”与这段动画的关联性最大,而“祝福”的关联性最小。因此,在图2所示实施例中,将同一资源对应的资 源标签的集合称为资源项,从而引入资源标签在所属资源项中的权重这一概念,结合文本关键字与资源标签的相似度,共同计算出文本关键字与资源项的匹配程度,进而在此基础上确定与文本信息相匹配的资源,从而更有利于准确、全面地确定与该文本信息相匹配的资源。
如实施例1中所述,文本关键字wj的词向量与资源标签tk的词向量的余弦相似度采用以下公式计算:
simjk=cos(vec(wj),vec(tk))(其中,j=1,2,3,...J,k=1,2,3,...K)
假设共有N个资源项,资源项Tn(n=1,2,3,...N)中有K个资源标签,表示为Tn={t1,t2,t3...tK},资源标签tk在所属资源项Tn中的权重表示为qnk(n=1,2,3,...N,k=1,2,3,...K),资源项中各资源标签的权重之和可取为1,即
Figure PCTCN2017097611-appb-000003
资源项中各资源标签的权重可以是系统预先设定的,也可以是基于神经网络训练学习得到的;可以是固定不变的,也可以是根据用户的使用和系统的自学习过程不断调整的。
进一步地,计算相似度与权重的乘积之和,即按照相对应的资源标签在所属资源项中的权重,计算文本关键字与资源标签的相似度的加权和,作为文本关键字与相对应的资源标签所属资源项的匹配程度。将文本关键字wj与资源项Tn的匹配程度记为Sjn,则按照以下公式计算得到Sjn
Figure PCTCN2017097611-appb-000004
(其中,j=1,2,3,...J,n=1,2,3,...N)
在此基础上,可以进一步对文本关键字与资源项的匹配程度进行排序,将最匹配的预设个资源项输出,用以确定与文本信息相匹配的资源。此时,在对匹配程度按照数值大小排序后,可以直接将匹配程度最高(即Sjn的值最大)的资源项作为与文本信息对应的资源项,进而将该资源项对应的资源确 定为与文本信息相匹配的资源;也可以将最匹配的预设个资源项输出,作为备选资源项向用户推荐供用户选取;将用户在备选资源项中选取的资源项所对应的资源确定为与文本信息相匹配的资源。
上述资源标签在所属资源项中的权重的确定可以包括以下过程:
首先对资源标签在所属资源项中的权重设定初始值;这一初始值,可以根据经验或者机器学习的结果设定,也可以对每一资源标签设定相同的权重(假设资源项中有K个资源标签,则每一资源标签的初始权重可设定为
Figure PCTCN2017097611-appb-000005
)。
然后,当用户在备选资源项中选取了某个资源项y后,可以依据用户选取的资源项y以及用户输入的文本信息,调整资源项y中的资源标签和/或调整资源标签在所属资源项y中的权重。具体地,可以先找到用户输入的文本信息中跟资源项y最匹配的文本关键字
Figure PCTCN2017097611-appb-000006
即找到与资源项y的匹配程度最高的文本关键字
Figure PCTCN2017097611-appb-000007
满足:
Figure PCTCN2017097611-appb-000008
若文本关键字
Figure PCTCN2017097611-appb-000009
已经在资源项y所包含的资源标签中,则更新该资源标签在资源项y中的权重(更新的方式可以是增大该资源标签的权重),否则将文本关键字
Figure PCTCN2017097611-appb-000010
作为新的资源标签增加到该资源项y中。对于新增的资源标签
Figure PCTCN2017097611-appb-000011
在新资源项y中的初始权重,可以将初始权重设定为
Figure PCTCN2017097611-appb-000012
即将文本关键字
Figure PCTCN2017097611-appb-000013
与原资源项y的匹配程度
Figure PCTCN2017097611-appb-000014
作为新增的资源标签
Figure PCTCN2017097611-appb-000015
在新资源项y中的初始权重;也可以计算文本关键字
Figure PCTCN2017097611-appb-000016
与原资源项y中各资源标签的相似度的和,作为新增的资源标签
Figure PCTCN2017097611-appb-000017
在新资源项y中的初始权重。再进一步对更新了权重的资源标签所在的资源项进行权重归一化。
在依据用户选取的资源项y以及用户输入的文本信息,调整资源项y中的资源标签和/或调整资源标签在所属资源项y中的权重时,也可以直接判断用户选取的资源项中包含有与文本关键字是否完全一致。若用户选取的资源 项中包含有与文本关键字完全一致的资源标签(相当于该资源标签与文本关键字的相似度可以取到最高),则可以增大该资源标签的权重;若用户选取的资源项中不包含与文本关键字完全一致的资源标签,则可以将文本关键字作为资源标签增加入该资源项中,还可相应的设定权重。在调整资源项中的资源标签和/或调整资源标签在所属资源项中的权重之后,还可以进一步对资源项中各资源标签的权重进行归一化处理,即按照原有比例进行调整,使得各资源标签的权重之和保持为1。
实施例3
在实施例2的基础上,参见图3所示,还可以在执行步骤S103获取用户的使用信息,使用信息包括用户的历史偏好信息、个人信息和/或同类用户的标签信息的基础上,在执行步骤S1021计算文本关键字与资源项的匹配程度之后,在执行步骤S1022依据文本关键字与各资源项的匹配程度,确定与文本信息相匹配的资源之前,还执行步骤S104依据用户的使用信息,对文本关键字与资源项的匹配程度进行调整,得到更新后的匹配程度。
用户的历史偏好信息、用户的个人信息(例如年龄、性别、地域等)、以及相似用户的标签信息,可以反映出用户对资源的倾向性选择。因此,依据这些使用信息对文本关键字与资源项的匹配程度进行调整,例如,可以将与用户的使用信息关联更紧密的资源项的匹配程度放大,采用乘以大于1的系数,或者增加一定数值等方式;又例如,可以将与用户的使用信息关联较弱的资源项的匹配程度缩小。针对调整后的匹配程度进行排序,进而对用户进行个性化信息推荐或直接将匹配程度最高的资源项推荐给用户。
需要说明的是,实施例1~实施例3所提供方法的各步骤的执行主体均可以是同一装置,或者,该方法也可由不同装置作为执行主体。
实施例4
本申请还提供了一种为文本信息匹配资源的装置100,参见图4所示,包括:
获取模块101,用于依据文本信息,获取文本关键字;
匹配模块102,用于依据文本关键字与资源标签的相似度,确定与文本信息相匹配的资源;其中,资源标签与资源相对应。
如图5所示,上述匹配模块102可进一步包括:
计算模块1021,用于依据文本关键字与资源标签的相似度、以及相对应的资源标签在所属资源项中的权重,计算文本关键字与资源项的匹配程度;其中,资源项中包含至少一个资源标签;
资源确定模块1022,用于依据文本关键字与各资源项的匹配程度,确定与文本信息相匹配的资源;其中,资源项中包含至少一个资源。
本实施例所提供的为文本信息匹配资源的装置,与实施例1~实施例3所述的方法相对应,在此不再赘述。
实施例5
基于实施例1~实施例4的陈述,以下就本申请所提供的为文本信息匹配资源的方法和装置给出具体的应用实例。
假设有四种资源项:
T1:生日快乐!(资源标签及其权重为:蛋糕0.2,歌曲0.15,生日0.5,快乐0.15)
T2:龙舟赛(资源标签及其权重为:龙舟0.8,比赛0.2)
T3:粽子(资源标签及其权重为:粽子0.7,端午节0.3)
T4:中秋节快乐(资源标签及其权重为:月饼0.6,团圆0.3,快乐0.1)
每种资源项中包含有至少一段与该资源项相对应的音乐资源。
获取到用户输入的文本信息为:端午节快乐!
则先对文本信息进行分词,获得文本关键字{端午节,快乐}。
根据词向量库中各词语的相似度,假设“端午节”与“龙舟”的相似度为0.8,“端午节”与“粽子”的相似度为0.9。在本例中,“端午节”与其他资源标签的相似度很小,“快乐”与除其自身以外的其他资源标签的相似度也很小,因此,在本例的后续计算中忽略不计。在实际实施时,可以设定一个相似度数值阈值,当两词语的相似度非常小,低于该阈值时,可以将该两词语的相似度的数值置为0,以简化计算。
则文本关键字“端午节”与资源项T2和T3的匹配程度分别为:0.8*0.8=0.64,0.7*0.9=0.63。
按类似方法计算,假设得到文本关键字“快乐”与资源项T1和T4的匹配程度分别为:0.15,0.1。
则按照匹配程度从高到低的顺序对对资源项进行排序,得到:T2,T3,T1,T4。
进一步地,考虑到用户的历史纪录、个人地域/性别等属性,可以对上述资源项进行重新排序。在这里表现为:根据用户的地理信息发现用户是北方人,北方端午节没有龙舟赛,那么,可以相应的降低文本关键字与T2的匹配程度,假如降权因子为0.9,则T2新的匹配程度为0.64*0.9=0.576。从而得到重新排序后的资源项为:T3,T2,T1,T4
再进一步地,假如用户点击了T3,则可以增加T3中“端午节”的权重。假如用户点击了T2,则可以在T2的资源标签中增加“端午节”这一标签。假如用户选择T1或者T4,则在相应的资源项中增加对应资源标签“快乐”的权重。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或 计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash  RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (14)

  1. 一种为文本信息匹配资源的方法,其特征在于,包括:
    依据所述文本信息,获取文本关键字;
    依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源;其中,所述资源标签与所述资源相对应。
  2. 按照权利要求1所述方法,其特征在于,所述文本关键字与资源标签的相似度的确定包括:
    从词向量库中分别获取所述文本关键字的第一词向量和所述资源标签的第二词向量;所述词向量库中包含至少一个分词的词向量;
    计算所述第一词向量与所述第二词向量的余弦相似度,作为所述文本关键字与所述资源标签的相似度。
  3. 按照权利要求2所述方法,其特征在于,所述词向量库中词向量的获得包括:
    获取用于训练词向量的训练语料;
    对所述训练语料进行分词,获得分词集合;
    依据所述分词集合中各分词的出现频次和/或与其他分词的共现关系,确定各分词的词向量;所述词向量中每一个元素表示对应分词的出现频次和/或与其他分词的共现频次。
  4. 按照权利要求1所述方法,其特征在于,依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源,包括:
    对所述文本关键字与所述资源标签的相似度进行排序;
    将相似度最高的预设个资源标签输出,用以确定与所述文本信息相匹配 的资源。
  5. 按照权利要求1所述方法,其特征在于,依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源,包括:
    依据所述文本关键字与所述资源标签的相似度、以及相对应的资源标签在所属资源项中的权重,计算所述文本关键字与所述资源项的匹配程度;其中,所述资源项中包含至少一个所述资源标签;
    依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源;其中,所述资源项中包含至少一个所述资源。
  6. 按照权利要求5所述方法,其特征在于,计算所述文本关键字与所述资源项的匹配程度,包括:
    计算所述相似度与所述权重的乘积之和,作为所述文本关键字与相对应的资源标签所属资源项的匹配程度。
  7. 按照权利要求5所述方法,其特征在于,依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源,包括:
    对所述文本关键字与所述资源项的匹配程度进行排序;
    将最匹配的预设个资源项输出,用以确定与所述文本信息相匹配的资源。
  8. 按照权利要求7所述方法,其特征在于,将最匹配的预设个资源项输出,用以确定与所述文本信息相匹配的资源,具体为:
    将最匹配的预设个资源项输出,作为备选资源项向用户推荐;
    将用户在所述备选资源项中选取的资源项所对应的资源确定为与所述文本信息相匹配的资源。
  9. 按照权利要求8所述方法,其特征在于,所述资源标签在所属资源项中的权重的确定包括:
    对所述资源标签在所属资源项中的权重设定初始值;
    依据用户在所述备选资源项中选取的资源项,调整所述资源项中的资源标签和/或调整资源标签在所属资源项中的权重。
  10. 按照权利要求5所述方法,其特征在于,所述方法还包括:
    获取用户的使用信息,所述使用信息包括用户的历史偏好信息、个人信息和/或同类用户的标签信息;
    则在计算所述文本关键字与所述资源项的匹配程度之后,在依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源之前,还包括:
    依据用户的所述使用信息,对所述文本关键字与所述资源项的匹配程度进行调整,得到更新后的匹配程度。
  11. 按照权利要求1所述方法,其特征在于,依据所述文本信息,获取文本关键字,包括:
    获取所述文本信息;
    对所述文本信息进行分词,得到所述文本关键字。
  12. 按照权利要求1~11之任一所述方法,其特征在于,所述资源的类别包括图片、照片、音乐、语音、音效、动作、表情、动画和/或视频。
  13. 一种为文本信息匹配资源的装置,其特征在于,包括:
    获取模块,用于依据所述文本信息,获取文本关键字;
    匹配模块,用于依据所述文本关键字与资源标签的相似度,确定与所述文本信息相匹配的资源;其中,所述资源标签与所述资源相对应。
  14. 按照权利要求13所述装置,其特征在于,所述匹配模块包括:
    计算模块,用于依据所述文本关键字与所述资源标签的相似度、以及相对应的资源标签在所属资源项中的权重,计算所述文本关键字与所述资源项的匹配程度;其中,所述资源项中包含至少一个所述资源标签;
    资源确定模块,用于依据所述文本关键字与各所述资源项的匹配程度,确定与所述文本信息相匹配的资源;其中,所述资源项中包含至少一个所述资源。
PCT/CN2017/097611 2016-09-14 2017-08-16 一种为文本信息匹配资源的方法及装置 WO2018049960A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610824080.1A CN106528588A (zh) 2016-09-14 2016-09-14 一种为文本信息匹配资源的方法及装置
CN201610824080.1 2016-09-14

Publications (1)

Publication Number Publication Date
WO2018049960A1 true WO2018049960A1 (zh) 2018-03-22

Family

ID=58343954

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/097611 WO2018049960A1 (zh) 2016-09-14 2017-08-16 一种为文本信息匹配资源的方法及装置

Country Status (2)

Country Link
CN (1) CN106528588A (zh)
WO (1) WO2018049960A1 (zh)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920546A (zh) * 2018-06-13 2018-11-30 杭州数理大数据技术有限公司 一种基于用户需求的稳态标签开发方法及系统
CN109033162A (zh) * 2018-06-19 2018-12-18 深圳市元征科技股份有限公司 一种数据处理方法、服务器及计算机可读介质
CN109582966A (zh) * 2018-12-03 2019-04-05 北京容联易通信息技术有限公司 一种信息匹配方法及装置
CN109614617A (zh) * 2018-06-01 2019-04-12 安徽省泰岳祥升软件有限公司 支持极性区分和多义的词向量生成方法及装置
CN109684446A (zh) * 2018-06-05 2019-04-26 安徽省泰岳祥升软件有限公司 文本语义相似度计算方法及装置
CN109857872A (zh) * 2019-02-18 2019-06-07 浪潮软件集团有限公司 基于知识图谱的信息推荐方法和装置
CN109871540A (zh) * 2019-02-21 2019-06-11 武汉斗鱼鱼乐网络科技有限公司 一种文本相似度的计算方法以及相关设备
CN110163121A (zh) * 2019-04-30 2019-08-23 腾讯科技(深圳)有限公司 图像处理方法、装置、计算机设备及存储介质
CN110263161A (zh) * 2019-05-29 2019-09-20 阿里巴巴集团控股有限公司 一种信息的处理方法、装置及设备
CN110659419A (zh) * 2019-09-17 2020-01-07 平安科技(深圳)有限公司 确定目标用户的方法及相关装置
CN111259117A (zh) * 2020-01-16 2020-06-09 广州拉卡拉信息技术有限公司 短文本批量匹配方法及装置
CN111400516A (zh) * 2020-03-16 2020-07-10 北京奇艺世纪科技有限公司 标签确定方法、电子设备及存储介质
CN111488453A (zh) * 2019-01-25 2020-08-04 北京猎户星空科技有限公司 资源分级方法、装置、设备及存储介质
CN111708819A (zh) * 2020-05-28 2020-09-25 北京百度网讯科技有限公司 用于信息处理的方法、装置、电子设备和存储介质
CN112037792A (zh) * 2020-08-20 2020-12-04 北京字节跳动网络技术有限公司 一种语音识别方法、装置、电子设备及存储介质
CN112989022A (zh) * 2021-03-16 2021-06-18 中国平安人寿保险股份有限公司 虚拟文本智能选取方法、装置以及计算机设备
CN113377971A (zh) * 2021-05-31 2021-09-10 北京达佳互联信息技术有限公司 多媒体资源生成方法、装置、电子设备以及存储介质

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528588A (zh) * 2016-09-14 2017-03-22 厦门幻世网络科技有限公司 一种为文本信息匹配资源的方法及装置
CN107193962B (zh) * 2017-05-24 2021-06-11 百度在线网络技术(北京)有限公司 一种互联网推广信息的智能配图方法及装置
CN109756751B (zh) * 2017-11-07 2023-02-03 腾讯科技(深圳)有限公司 多媒体数据处理方法及装置、电子设备、存储介质
CN107895200A (zh) * 2017-11-15 2018-04-10 广东天泽阳光康众医疗投资管理有限公司 一种智能预约挂号方法、装置、终端设备及存储介质
CN108776901B (zh) * 2018-04-27 2021-01-15 微梦创科网络科技(中国)有限公司 基于搜索词的广告推荐方法及系统
CN109376352B (zh) * 2018-08-28 2022-11-29 中山大学 一种基于word2vec和语义相似度的专利文本建模方法
CN109144954B (zh) * 2018-09-18 2021-03-16 北京字节跳动网络技术有限公司 编辑文档的资源推荐方法、装置及电子设备
CN109657710B (zh) * 2018-12-06 2022-01-21 北京达佳互联信息技术有限公司 数据筛选方法、装置、服务器及存储介质
CN110020411B (zh) * 2019-03-29 2020-10-09 上海掌门科技有限公司 图文内容生成方法及设备
CN110377558B (zh) * 2019-06-14 2023-06-20 平安科技(深圳)有限公司 文档查询方法、装置、计算机设备和存储介质
CN110516061A (zh) * 2019-07-24 2019-11-29 视联动力信息技术股份有限公司 一种数据处理方法、装置和计算机可读存储介质
CN111126054B (zh) * 2019-12-03 2024-03-05 东软集团股份有限公司 确定相似文本的方法、装置、存储介质及电子设备
CN111178064B (zh) * 2019-12-13 2022-11-29 深圳平安医疗健康科技服务有限公司 基于字段分词处理的信息推送方法、装置和计算机设备
CN111191454A (zh) * 2020-01-06 2020-05-22 精硕科技(北京)股份有限公司 一种实体匹配的方法及装置
CN111460177B (zh) * 2020-03-27 2023-12-15 北京奇艺世纪科技有限公司 影视类表情搜索方法、装置、存储介质、计算机设备
CN112148904B (zh) * 2020-07-31 2021-07-27 中标慧安信息技术股份有限公司 一种报警联动录像的索引方法及装置
CN113342179A (zh) * 2021-05-26 2021-09-03 北京百度网讯科技有限公司 输入文本的处理方法、装置、电子设备和存储介质
CN113870133B (zh) * 2021-09-27 2024-03-12 抖音视界有限公司 多媒体显示及匹配方法、装置、设备及介质
CN114040142A (zh) * 2021-11-05 2022-02-11 深圳壹账通智能科技有限公司 智能外呼机器人的视频通话方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984437A (zh) * 2010-11-23 2011-03-09 亿览在线网络技术(北京)有限公司 音乐资源个性化推荐方法及系统
CN103412880A (zh) * 2013-07-17 2013-11-27 百度在线网络技术(北京)有限公司 一种用于确定多媒体资源间隐式关联信息的方法与设备
CN105893410A (zh) * 2015-11-18 2016-08-24 乐视网信息技术(北京)股份有限公司 一种关键词提取方法和装置
CN106528588A (zh) * 2016-09-14 2017-03-22 厦门幻世网络科技有限公司 一种为文本信息匹配资源的方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102419773B (zh) * 2011-12-13 2014-09-03 百度在线网络技术(北京)有限公司 一种用于对资源项进行排序的方法、装置和设备
CN103425687A (zh) * 2012-05-21 2013-12-04 阿里巴巴集团控股有限公司 一种基于关键词的检索方法和系统
CN104636334A (zh) * 2013-11-06 2015-05-20 阿里巴巴集团控股有限公司 一种关键词推荐方法和装置
CN104239535B (zh) * 2014-09-22 2018-04-27 重庆邮电大学 一种为文字配图的方法、服务器、终端及系统
JP6446987B2 (ja) * 2014-10-16 2019-01-09 日本電気株式会社 映像選択装置、映像選択方法、映像選択プログラム、特徴量生成装置、特徴量生成方法及び特徴量生成プログラム
CN105354182B (zh) * 2015-09-28 2018-06-26 北大方正集团有限公司 获取相关数字资源的方法及使用其生成专题的方法及装置
CN105824904B (zh) * 2016-03-15 2018-12-25 浙江大学 基于中医药领域专业词向量的中草药植物图片爬取方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101984437A (zh) * 2010-11-23 2011-03-09 亿览在线网络技术(北京)有限公司 音乐资源个性化推荐方法及系统
CN103412880A (zh) * 2013-07-17 2013-11-27 百度在线网络技术(北京)有限公司 一种用于确定多媒体资源间隐式关联信息的方法与设备
CN105893410A (zh) * 2015-11-18 2016-08-24 乐视网信息技术(北京)股份有限公司 一种关键词提取方法和装置
CN106528588A (zh) * 2016-09-14 2017-03-22 厦门幻世网络科技有限公司 一种为文本信息匹配资源的方法及装置

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614617A (zh) * 2018-06-01 2019-04-12 安徽省泰岳祥升软件有限公司 支持极性区分和多义的词向量生成方法及装置
CN109614617B (zh) * 2018-06-01 2022-12-16 安徽省泰岳祥升软件有限公司 支持极性区分和多义的词向量生成方法及装置
CN109684446B (zh) * 2018-06-05 2023-12-26 安徽省泰岳祥升软件有限公司 文本语义相似度计算方法及装置
CN109684446A (zh) * 2018-06-05 2019-04-26 安徽省泰岳祥升软件有限公司 文本语义相似度计算方法及装置
CN108920546A (zh) * 2018-06-13 2018-11-30 杭州数理大数据技术有限公司 一种基于用户需求的稳态标签开发方法及系统
CN108920546B (zh) * 2018-06-13 2020-09-11 杭州数理大数据技术有限公司 一种基于用户需求的稳态标签开发方法及系统
CN109033162A (zh) * 2018-06-19 2018-12-18 深圳市元征科技股份有限公司 一种数据处理方法、服务器及计算机可读介质
CN109582966A (zh) * 2018-12-03 2019-04-05 北京容联易通信息技术有限公司 一种信息匹配方法及装置
CN111488453B (zh) * 2019-01-25 2024-02-23 北京猎户星空科技有限公司 资源分级方法、装置、设备及存储介质
CN111488453A (zh) * 2019-01-25 2020-08-04 北京猎户星空科技有限公司 资源分级方法、装置、设备及存储介质
CN109857872A (zh) * 2019-02-18 2019-06-07 浪潮软件集团有限公司 基于知识图谱的信息推荐方法和装置
CN109871540A (zh) * 2019-02-21 2019-06-11 武汉斗鱼鱼乐网络科技有限公司 一种文本相似度的计算方法以及相关设备
CN109871540B (zh) * 2019-02-21 2022-12-23 武汉斗鱼鱼乐网络科技有限公司 一种文本相似度的计算方法以及相关设备
CN110163121A (zh) * 2019-04-30 2019-08-23 腾讯科技(深圳)有限公司 图像处理方法、装置、计算机设备及存储介质
CN110163121B (zh) * 2019-04-30 2023-09-05 腾讯科技(深圳)有限公司 图像处理方法、装置、计算机设备及存储介质
CN110263161A (zh) * 2019-05-29 2019-09-20 阿里巴巴集团控股有限公司 一种信息的处理方法、装置及设备
CN110263161B (zh) * 2019-05-29 2023-09-26 创新先进技术有限公司 一种信息的处理方法、装置及设备
CN110659419A (zh) * 2019-09-17 2020-01-07 平安科技(深圳)有限公司 确定目标用户的方法及相关装置
CN110659419B (zh) * 2019-09-17 2023-09-05 平安科技(深圳)有限公司 确定目标用户的方法及相关装置
CN111259117B (zh) * 2020-01-16 2023-11-21 广州拉卡拉信息技术有限公司 短文本批量匹配方法及装置
CN111259117A (zh) * 2020-01-16 2020-06-09 广州拉卡拉信息技术有限公司 短文本批量匹配方法及装置
CN111400516B (zh) * 2020-03-16 2024-04-16 北京奇艺世纪科技有限公司 标签确定方法、电子设备及存储介质
CN111400516A (zh) * 2020-03-16 2020-07-10 北京奇艺世纪科技有限公司 标签确定方法、电子设备及存储介质
CN111708819B (zh) * 2020-05-28 2023-04-07 北京百度网讯科技有限公司 用于信息处理的方法、装置、电子设备和存储介质
CN111708819A (zh) * 2020-05-28 2020-09-25 北京百度网讯科技有限公司 用于信息处理的方法、装置、电子设备和存储介质
CN112037792B (zh) * 2020-08-20 2022-06-17 北京字节跳动网络技术有限公司 一种语音识别方法、装置、电子设备及存储介质
CN112037792A (zh) * 2020-08-20 2020-12-04 北京字节跳动网络技术有限公司 一种语音识别方法、装置、电子设备及存储介质
CN112989022B (zh) * 2021-03-16 2022-11-25 中国平安人寿保险股份有限公司 虚拟文本智能选取方法、装置以及计算机设备
CN112989022A (zh) * 2021-03-16 2021-06-18 中国平安人寿保险股份有限公司 虚拟文本智能选取方法、装置以及计算机设备
CN113377971A (zh) * 2021-05-31 2021-09-10 北京达佳互联信息技术有限公司 多媒体资源生成方法、装置、电子设备以及存储介质
CN113377971B (zh) * 2021-05-31 2024-02-27 北京达佳互联信息技术有限公司 多媒体资源生成方法、装置、电子设备以及存储介质

Also Published As

Publication number Publication date
CN106528588A (zh) 2017-03-22

Similar Documents

Publication Publication Date Title
WO2018049960A1 (zh) 一种为文本信息匹配资源的方法及装置
US11720572B2 (en) Method and system for content recommendation
CN110892399B (zh) 自动生成主题内容摘要的系统和方法
US10042896B2 (en) Providing search recommendation
CN110442777B (zh) 基于bert的伪相关反馈模型信息检索方法及系统
CN104885081B (zh) 搜索系统和相应方法
CN109165380B (zh) 一种神经网络模型训练方法及装置、文本标签确定方法及装置
US9846836B2 (en) Modeling interestingness with deep neural networks
US11929066B2 (en) Intent-based conversational knowledge graph for spoken language understanding system
CN111190997B (zh) 一种使用神经网络和机器学习排序算法的问答系统实现方法
WO2019228203A1 (zh) 一种短文本分类方法及系统
US20130060769A1 (en) System and method for identifying social media interactions
CN111046221A (zh) 歌曲推荐方法、装置、终端设备以及存储介质
CN105760363B (zh) 文本文件的词义消歧方法及装置
CN112364624B (zh) 基于深度学习语言模型融合语义特征的关键词提取方法
US20200073890A1 (en) Intelligent search platforms
WO2022141876A1 (zh) 基于词向量的搜索方法、装置、设备及存储介质
Alami et al. Hybrid method for text summarization based on statistical and semantic treatment
CN108875743B (zh) 一种文本识别方法及装置
JP2019082931A (ja) 検索装置、類似度算出方法、およびプログラム
WO2023033942A1 (en) Efficient index lookup using language-agnostic vectors and context vectors
KR20180113444A (ko) 개체명 연결 방법, 장치, 시스템 및 컴퓨터 프로그램
Suneera et al. A bert-based question representation for improved question retrieval in community question answering systems
CN111460177A (zh) 影视类表情搜索方法、装置、存储介质、计算机设备
CN107729509B (zh) 基于隐性高维分布式特征表示的篇章相似度判定方法

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: 17850162

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 21/05/2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17850162

Country of ref document: EP

Kind code of ref document: A1