CN110929017B - Text recommendation method and device - Google Patents

Text recommendation method and device Download PDF

Info

Publication number
CN110929017B
CN110929017B CN201911164244.2A CN201911164244A CN110929017B CN 110929017 B CN110929017 B CN 110929017B CN 201911164244 A CN201911164244 A CN 201911164244A CN 110929017 B CN110929017 B CN 110929017B
Authority
CN
China
Prior art keywords
text
semantic feature
feature vector
paragraph
recommended
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911164244.2A
Other languages
Chinese (zh)
Other versions
CN110929017A (en
Inventor
侯兴林
李如寐
李彦
亓超
马宇驰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911164244.2A priority Critical patent/CN110929017B/en
Publication of CN110929017A publication Critical patent/CN110929017A/en
Application granted granted Critical
Publication of CN110929017B publication Critical patent/CN110929017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the disclosure discloses a text recommending method and device, relates to the technical field of Internet, and can solve the problem that in the prior art, classification of article categories in web pages is rough, and users cannot quickly acquire articles of the same category. The method of the embodiment of the disclosure mainly comprises the following steps: acquiring a semantic feature vector of a first text according to the first text presented by a current page of a user; inquiring in a preset database according to the semantic feature vector of the first text to obtain a second text similar to the first text; and taking the second text as a text to be recommended. Through the semantic feature vector of the first text presented by the current page of the user, the second text similar to the first text can be queried and recommended to the user as the recommended text, and compared with the prior art, the text related to the text being read by the user can be quickly recommended to the user, so that the user can quickly acquire the text which is closer to the text being read.

Description

Text recommendation method and device
Technical Field
The embodiment of the disclosure relates to the technical field of Internet, in particular to a text recommending method and device.
Background
In general, different people may be interested in different types of articles, for example news, and news content currently browsed by users in news APP is generally categorized. For example, news in a news website may be classified into domestic news, international news, military news, financial news, entertainment news, sports news, etc., and these categories are presented in a home page so that a user can quickly find favorite articles by clicking on favorite categories.
However, due to the limitation of the display space of the web page, the classification of the news category is still rough, for example, a person is included in one article, and a food related to the person is included, which cannot accurately recommend related news content for the user.
Disclosure of Invention
The method and the device solve the problem that in the prior art, classification of article categories in web pages is rough, and users cannot quickly acquire articles of the same category.
The embodiment of the disclosure mainly provides the following technical scheme:
in a first aspect, an embodiment of the present disclosure provides a text recommendation method, including:
acquiring a semantic feature vector of a first text according to the first text presented by a current page of a user;
inquiring in a preset database according to the semantic feature vector of the first text to obtain a second text similar to the first text;
and taking the second text as a text to be recommended.
In some embodiments, the obtaining the semantic feature vector of the first text includes:
obtaining semantic feature vectors of each word according to character codes in the first text;
and obtaining the semantic feature vector of the first text according to the semantic feature vector of each word.
In some embodiments, the obtaining the semantic feature vector of the first text according to the semantic feature vector of each word includes:
and accumulating and averaging the semantic feature vectors of each word to obtain the semantic feature vector of the first text.
In some embodiments, the obtaining the semantic feature vector of the first text according to the semantic feature vector of each word includes:
the weight of the current general semantic feature vector and each word is obtained through the initial general semantic feature vector and each word semantic feature vector of the current sentence, and the semantic feature vector of the first text is obtained through the weight and each word semantic feature vector.
In some embodiments, further comprising:
and displaying the text to be recommended.
In some embodiments, the presenting the text to be recommended includes:
receiving a first touch control on the first text, and displaying the text to be recommended according to the first touch control; or (b)
And receiving a second touch control of a preset button corresponding to the first text, and displaying the text to be recommended according to the second touch control.
In some embodiments, the first text includes at least two paragraphs, and the obtaining the semantic feature vector of the first text includes:
performing paragraph splitting on the first text according to a preset rule;
acquiring semantic feature vectors corresponding to characters in a currently presented paragraph;
and calculating the semantic feature vector corresponding to the currently presented paragraph as the semantic feature vector of the first text according to the semantic feature vector corresponding to the text in the currently presented paragraph.
In some embodiments, the presenting the text to be recommended includes:
receiving a third touch control on a first paragraph of the first text or a preset button corresponding to the first paragraph, and displaying a text to be recommended corresponding to the first paragraph according to the third touch control;
or (b)
And counting the space of each paragraph, and displaying and recommending the text to be recommended corresponding to the paragraph with longer space in front.
In a second aspect, an embodiment of the present disclosure provides a text recommendation apparatus, including:
the acquisition unit is used for acquiring semantic feature vectors of a first text according to the first text presented by a current page of a user;
the query unit is used for querying a preset database to obtain a second text similar to the first text according to the semantic feature vector of the first text;
and the recommending unit is used for taking the second text as a text to be recommended.
In some embodiments, the acquisition unit comprises:
the first vector acquisition module is used for obtaining the semantic feature vector of each word according to the character codes in the first text;
and the second vector acquisition module is used for acquiring the semantic feature vector of the first text according to the semantic feature vector of each word.
In some embodiments, the second vector obtaining module is specifically configured to average the semantic feature vector accumulation of each word to obtain a semantic feature vector of the first text.
In some embodiments, the second vector obtaining module is specifically configured to obtain the weight of the current general semantic feature vector and each word through the initial general semantic feature vector and each word semantic feature vector of the current sentence, and obtain the semantic feature vector of the first text through the weight and each word semantic feature vector.
In some embodiments, further comprising:
and the display unit is used for displaying the text to be recommended.
In some embodiments, the display unit comprises:
the first display module is used for receiving first touch control on the first text and displaying the text to be recommended according to the first touch control; or (b)
And the second display module is used for receiving second touch control of a preset button corresponding to the first text and displaying the text to be recommended according to the second touch control.
In some embodiments, the first text includes at least two paragraphs, and the obtaining unit includes:
the paragraph splitting module is used for splitting the paragraphs of the first text according to a preset rule;
the acquisition module is used for acquiring semantic feature vectors corresponding to characters in the currently presented paragraph;
the calculating module is used for calculating the semantic feature vector corresponding to the currently presented paragraph as the semantic feature vector of the first text according to the semantic feature vector corresponding to the text in the currently presented paragraph.
In some embodiments, the display unit comprises:
the third display module is used for receiving third touch control of a first paragraph of the first text or a preset button corresponding to the first paragraph, and displaying the text to be recommended corresponding to the first paragraph according to the third touch control;
or (b)
And the fourth display module is used for counting the space of each paragraph and displaying the text to be recommended corresponding to the paragraph with longer space in front for recommendation.
In a third aspect, an embodiment of the present disclosure provides a storage medium, where the storage medium includes a stored program, and when the program runs, controls a device where the storage medium is located to execute the text recommendation method described in the first aspect.
The storage medium may include volatile memory, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
In a fourth aspect, embodiments of the present disclosure provide a text recommendation apparatus, the apparatus comprising a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; and executing the text recommending method in the first aspect when the program instructions are run.
By means of the technical scheme, the text recommendation method and device provided by the technical scheme of the invention have at least the following advantages:
in the technical scheme provided by the embodiment of the disclosure, in the page reading text, the user can query the second text similar to the first text as the recommended text to recommend to the user through the semantic feature vector of the first text presented by the current page of the user.
The foregoing description is merely an overview of the technical solutions of the embodiments of the present disclosure, and may be implemented according to the content of the specification in order to make the technical means of the embodiments of the present disclosure more clearly understood, and in order to make the foregoing and other objects, features and advantages of the embodiments of the present disclosure more comprehensible, the following detailed description of the embodiments of the present disclosure.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the embodiments of the disclosure. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 illustrates a flow chart of a text recommendation method provided by an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of another text recommendation method provided by embodiments of the present disclosure;
FIG. 3 illustrates a flow chart of yet another text recommendation method provided by an embodiment of the present disclosure;
FIG. 4 illustrates a block diagram of a text recommender provided by an embodiment of the present disclosure;
fig. 5 shows a block diagram of a specific text recommendation device provided by an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In a first aspect, an embodiment of the present disclosure provides a text recommendation method, as shown in fig. 1, where the method includes:
101. acquiring a semantic feature vector of a first text according to the first text presented by a current page of a user;
in the process of reading the webpage, the user can display the titles corresponding to different texts in the webpage, and according to the selection of the user, the texts corresponding to the titles selected by the user are displayed. In actual browsing, a user may open different texts corresponding to a plurality of topics at the same time, where the different texts correspond to different windows.
In some embodiments, the semantic feature vector of the first text is obtained, and the semantic feature vector can be calculated according to the text selected by the user as the first text, so that the user can select the interested part in the reading process, and the selection mode is not limited to operations such as mouse selection, gesture touch control selection and the like. In some embodiments, the semantic feature vector of the first text is obtained, and the semantic feature vector can be calculated according to the text corresponding to the paragraph in which the cursor is located as the first text, so that the user can move the cursor to the paragraph of interest in the reading process. It is to be readily understood that, to meet different user requirements, the semantic feature vector of the first text of the current page presentation may also be obtained in other manners, and embodiments of the present invention are not limited thereto.
In a specific implementation, the obtaining the semantic feature vector of the first text may include: obtaining semantic feature vectors of each word according to character codes in the first text; and obtaining the semantic feature vector of the first text according to the semantic feature vector of each word. The obtaining the semantic feature vector of the first text according to the semantic feature vector of each word may be obtained by adopting an averaging calculation method, for example, the obtaining the semantic feature vector of the first text according to the semantic feature vector of each word includes: and accumulating and averaging the semantic feature vectors of each word to obtain the semantic feature vector of the first text. The semantic feature vector of the first text may be obtained according to the semantic feature vector of each word, or may be obtained by adopting a weighted calculation method, for example, the obtaining the semantic feature vector of the first text according to the semantic feature vector of each word includes: the weight of the current general semantic feature vector and each word is obtained through the initial general semantic feature vector and each word semantic feature vector of the current sentence, and the semantic feature vector of the first text is obtained through the weight and each word semantic feature vector. Specifically, in the weighted calculation, a transducer model structure can be adopted to obtain the semantic feature vector of the first text according to the semantic feature vector of each word, the transducer model based on the Attention abandons the inherent fixed form and does not use any CNN or RNN structure, and the model can work in high parallel and has higher semantic analysis performance.
102. Inquiring in a preset database according to the semantic feature vector of the first text to obtain a second text similar to the first text;
the method comprises the steps of storing a large number of texts in a preset database as a database of recommended texts, recording semantic feature vectors of each text in the preset database, and inquiring a second text similar to the first text, wherein the step of inquiring the second text comprises the following steps: searching the text with the smallest semantic feature vector numerical difference with the first text from the text in the preset database as a second text, namely searching the text as a single text. Alternatively, the step of querying a second text similar to the first text includes: searching texts with the semantic feature vector numerical difference within a preset range from the texts in a preset database as second texts, wherein the number of the second texts is not limited to 1 or a plurality of similar texts.
103. And taking the second text as a text to be recommended.
The text to be recommended can be recommended to a user who is reading the first text, and the user can quickly acquire the second text related to the first text when reading the first text.
In the technical scheme provided by the embodiment of the disclosure, in the page reading text, the user can query the second text similar to the first text as the recommended text to recommend to the user through the semantic feature vector of the first text presented by the current page of the user.
In the embodiment provided by the present invention, as shown in fig. 2, after step 103, the method further includes:
104. and displaying the text to be recommended.
The manner of displaying the text to be recommended may be active, for example, the text to be recommended is displayed on one side of the first text, and the user can directly read the text to be recommended from one side of the first text. In practice, however, the manner in which the text to be recommended is often presented may be passive presentation. And displaying the text to be recommended by acquiring a display control instruction of the user. The display manipulation instruction may be provided in different forms, for example, may be provided as a link of a first text, and displaying the text to be recommended includes: and receiving a first touch control on the first text, and displaying the text to be recommended according to the first touch control. The method is suitable for application scenes of single recommended texts. For an application scenario not limited to a single recommended text, a link of a preset button may be set, and displaying the text to be recommended includes: and receiving a second touch control of a preset button corresponding to the first text, and displaying the text to be recommended according to the second touch control. The number of the preset buttons can be multiple, the number of the preset buttons is the same as that of the texts to be recommended, and different preset buttons correspond to different texts to be recommended.
In a second aspect, based on the text recommendation method of the first aspect, an embodiment of the present disclosure provides a text recommendation method, adapted for the first text to include at least two paragraphs, as shown in fig. 3, the method including:
200, acquiring a first text presented by a current page of a user, wherein the first text presented by the current page comprises at least two paragraphs, namely, the first text presented by the current page comprises at least one line-dividing symbol, and judging that the first text comprises at least two paragraphs.
Obtaining the semantic feature vector of the first text comprises the following steps:
201. performing paragraph splitting on the first text according to a preset rule;
after the first text currently presented is read, the paragraphs may be divided according to the position of the line separator at the first text, the text between the line separator and the line separator is respectively used as one paragraph, the text above the line separator at the top is used as one paragraph, and the text below the line separator at the bottom is used as one paragraph.
202. Acquiring semantic feature vectors corresponding to characters in a currently presented paragraph;
in the continuous reading process, the number of paragraphs displayed by the current page can be changed, and for a scene presenting a single paragraph, the semantic feature vector corresponding to the text in the paragraph can be directly obtained. For a scene where a plurality of paragraphs are presented at the same time, semantic feature vectors corresponding to characters in different paragraphs can be obtained respectively, but the method is not limited thereto, and semantic feature vectors corresponding to characters in paragraphs corresponding to preset rules can be obtained according to preset rules, for example, semantic feature vectors corresponding to characters in paragraphs with longer length can be obtained independently, but the method is not limited thereto.
203. And calculating the semantic feature vector corresponding to the currently presented paragraph as the semantic feature vector of the first text according to the semantic feature vector corresponding to the text in the currently presented paragraph.
And in a scene of acquiring semantic feature vectors corresponding to characters in a plurality of paragraphs, respectively calculating the semantic feature vector corresponding to each paragraph as the semantic feature vector of each paragraph of the first text.
204. Inquiring in a preset database according to the semantic feature vector of the first text to obtain a second text similar to the first text;
and in the step of inquiring, respectively inquiring in a preset database to obtain a second text similar to each paragraph of the first text. The text in the preset database is a single-paragraph text, so that text data obtained by query can be similar as much as possible, namely, the paragraph text is adopted for query matching of the paragraph text, so that the accuracy of query recommendation is maintained.
205. And taking the second text as a text to be recommended.
206. And displaying the text to be recommended.
And displaying different texts to be recommended corresponding to different paragraphs in the texts to be recommended.
In the passive display process, the display of the text to be recommended is realized by acquiring a display control instruction of a user. The display control instruction can be provided with different forms, for example, can be set as a link of a paragraph of the first text, a third touch control on the first paragraph of the first text is received, and the text to be recommended corresponding to the first paragraph is displayed according to the third touch control. For example, a link of a preset button may be set, a third touch of the preset button corresponding to the first paragraph of the first text is received, and the text to be recommended corresponding to the first paragraph is displayed according to the third touch.
In the plurality of text display recommendations to be recommended, the display order of the plurality of text to be recommended may be ordered, for example, according to the paragraph length. In the displaying process, displaying the text to be recommended may include: and counting the space of each paragraph, and displaying and recommending the text to be recommended corresponding to the paragraph with longer space in front. That is, if 3 paragraphs are displayed in the current page at the same time, the recommended text corresponding to the longer paragraph may be displayed before the recommended text.
According to the technical scheme provided by the embodiment of the disclosure, the first text presented by the current page is split according to the preset rule, the second text similar to each paragraph is respectively inquired and used as the recommended text, and compared with the manual classification mode in the prior art, the user can more accurately acquire the text similar to the first text by adopting the paragraph recommendation mode.
In a third aspect, an embodiment of the present disclosure provides a text recommendation apparatus, as shown in fig. 4, including:
the acquiring unit 10 is configured to acquire a semantic feature vector of a first text presented on a current page of a user according to the first text;
the query unit 20 is configured to query a preset database for obtaining a second text similar to the first text according to the semantic feature vector of the first text;
and a recommending unit 30, configured to take the second text as a text to be recommended.
In some embodiments, as shown in fig. 5, the acquiring unit 10 includes:
a first vector obtaining module 11, configured to obtain a semantic feature vector of each word according to the character codes in the first text;
a second vector obtaining module 12, configured to obtain a semantic feature vector of the first text according to the semantic feature vector of each word.
In some embodiments, the second vector obtaining module 12 is specifically configured to average the semantic feature vector accumulation of each word, to obtain a semantic feature vector of the first text.
In some embodiments, the second vector obtaining module 12 is specifically configured to obtain the current general semantic feature vector and the weight of each word through the initial general semantic feature vector and the semantic feature vector of each word of the current sentence, and obtain the semantic feature vector of the first text through the weight and the semantic feature vector of each word.
In some embodiments, further comprising:
and the display unit 40 is configured to display the text to be recommended.
In some embodiments, the display unit 40 includes:
the first display module 41 is configured to receive a first touch on the first text, and display the text to be recommended according to the first touch; or (b)
And the second display module 42 is configured to receive a second touch of a preset button corresponding to the first text, and display the text to be recommended according to the second touch.
In some embodiments, the first text includes at least two paragraphs, and the obtaining unit 10 includes:
a paragraph splitting module 13, configured to split paragraphs of the first text according to a preset rule;
an obtaining module 14, configured to obtain a semantic feature vector corresponding to a text in a currently presented paragraph;
the calculating module 15 is configured to calculate, according to the semantic feature vector corresponding to the text in the currently presented paragraph, the semantic feature vector corresponding to the currently presented paragraph as the semantic feature vector of the first text.
In some embodiments, the display unit 40 includes:
a third display module 43, configured to receive a third touch on the first paragraph of the first text or a preset button corresponding to the first paragraph, and display a text to be recommended corresponding to the first paragraph according to the third touch;
or (b)
The fourth display module 44 is configured to count the space of each paragraph, and display the text to be recommended corresponding to the paragraph with longer space before recommendation.
In a fourth aspect, an embodiment of the present disclosure provides a storage medium, where the storage medium includes a stored program, and when the program runs, controls a device where the storage medium is located to execute the text recommendation method in the first aspect or the second aspect.
The storage medium may include volatile memory, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
In a fifth aspect, embodiments of the present disclosure provide a text recommendation apparatus, the apparatus comprising a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; the program instructions execute the text recommendation method according to the first or second aspect when executed.
In a sixth aspect, A1, a text recommendation method includes:
acquiring a semantic feature vector of a first text according to the first text presented by a current page of a user;
inquiring in a preset database according to the semantic feature vector of the first text to obtain a second text similar to the first text;
and taking the second text as a text to be recommended.
A2, according to the recommendation method of A1, the obtaining the semantic feature vector of the first text includes:
obtaining semantic feature vectors of each word according to character codes in the first text;
and obtaining the semantic feature vector of the first text according to the semantic feature vector of each word.
A3, according to the recommendation method of A2, the semantic feature vector of the first text is obtained according to the semantic feature vector of each word, and the recommendation method comprises the following steps:
and accumulating and averaging the semantic feature vectors of each word to obtain the semantic feature vector of the first text.
A4, according to the recommendation method of A2, the semantic feature vector of the first text is obtained according to the semantic feature vector of each word, and the recommendation method comprises the following steps:
the weight of the current general semantic feature vector and each word is obtained through the initial general semantic feature vector and each word semantic feature vector of the current sentence, and the semantic feature vector of the first text is obtained through the weight and each word semantic feature vector.
A5, the recommendation method according to any one of A1-4, further comprising:
and displaying the text to be recommended.
A6, displaying the text to be recommended according to the recommendation method of A5, wherein the displaying comprises the following steps:
receiving a first touch control on the first text, and displaying the text to be recommended according to the first touch control; or (b)
And receiving a second touch control of a preset button corresponding to the first text, and displaying the text to be recommended according to the second touch control.
A7, according to the recommendation method of A5, the first text comprises at least two paragraphs, and the obtaining the semantic feature vector of the first text comprises:
performing paragraph splitting on the first text according to a preset rule;
acquiring semantic feature vectors corresponding to characters in a currently presented paragraph;
and calculating the semantic feature vector corresponding to the currently presented paragraph as the semantic feature vector of the first text according to the semantic feature vector corresponding to the text in the currently presented paragraph.
A8, displaying the text to be recommended according to the recommendation method of A7 comprises the following steps:
receiving a third touch control on a first paragraph of the first text or a preset button corresponding to the first paragraph, and displaying a text to be recommended corresponding to the first paragraph according to the third touch control;
or (b)
And counting the space of each paragraph, and displaying and recommending the text to be recommended corresponding to the paragraph with longer space in front.
Seventh aspect, B9, a text recommendation device, including:
the acquisition unit is used for acquiring semantic feature vectors of a first text according to the first text presented by a current page of a user;
the query unit is used for querying a preset database to obtain a second text similar to the first text according to the semantic feature vector of the first text;
and the recommending unit is used for taking the second text as a text to be recommended.
B10, the recommendation device according to B9, the acquisition unit comprising:
the first vector acquisition module is used for obtaining the semantic feature vector of each word according to the character codes in the first text;
and the second vector acquisition module is used for acquiring the semantic feature vector of the first text according to the semantic feature vector of each word.
And B11, according to the recommendation device described in B10, the second vector acquisition module is specifically configured to perform accumulation and averaging on the semantic feature vectors of each word to obtain a semantic feature vector of the first text.
And B12, according to the recommendation device described in B10, the second vector obtaining module is specifically configured to obtain weights of the current general semantic feature vector and each word through the initial general semantic feature vector and each word semantic feature vector of the current sentence, and obtain a semantic feature vector of the first text through the weights and each word semantic feature vector.
B13, the recommendation device according to any one of B9-12, further comprising:
and the display unit is used for displaying the text to be recommended.
B14, the recommendation device of B13, the display unit includes:
the first display module is used for receiving first touch control on the first text and displaying the text to be recommended according to the first touch control; or (b)
And the second display module is used for receiving second touch control of a preset button corresponding to the first text and displaying the text to be recommended according to the second touch control.
B15, the recommending device according to B13, wherein the first text comprises at least two paragraphs, and the acquiring unit comprises:
the paragraph splitting module is used for splitting the paragraphs of the first text according to a preset rule;
the acquisition module is used for acquiring semantic feature vectors corresponding to characters in the currently presented paragraph;
the calculating module is used for calculating the semantic feature vector corresponding to the currently presented paragraph as the semantic feature vector of the first text according to the semantic feature vector corresponding to the text in the currently presented paragraph.
B16, the recommendation device according to B15, the display unit comprising:
the third display module is used for receiving third touch control of a first paragraph of the first text or a preset button corresponding to the first paragraph, and displaying the text to be recommended corresponding to the first paragraph according to the third touch control;
or (b)
And the fourth display module is used for counting the space of each paragraph and displaying the text to be recommended corresponding to the paragraph with longer space in front for recommendation.
In an eighth aspect, C17 is a storage medium, where the storage medium includes a stored program, and where the program, when executed, controls a device in which the storage medium is located to execute the text recommendation method of any one of A1 to A8.
In a ninth aspect, D18 is a text recommendation device, the device comprising a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; the program instructions, when executed, perform the method of recommending text according to any of A1 to A8.
It will be apparent to those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, embodiments of the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, embodiments of the present disclosure may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, embodiments of the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, embodiments of the present disclosure may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (14)

1. A method for recommending text, comprising:
acquiring a first text presented by a current page being read by a user, wherein the first text presented by the current page comprises at least two paragraphs, and the number of the paragraphs presented in the current page can change along with the reading of the user;
paragraph division is carried out on the first text according to a preset rule;
when the current page only presents a single paragraph, acquiring a semantic feature vector corresponding to characters in the paragraph presented currently; adopting a transducer model structure, and calculating a semantic feature vector corresponding to the currently presented paragraph according to the semantic feature vector corresponding to the text in the currently presented paragraph, wherein the semantic feature vector corresponds to the currently presented paragraph and is used as the semantic feature vector of the first text;
when the current page presents a plurality of paragraphs at the same time, semantic feature vectors corresponding to texts in different paragraphs are respectively obtained; respectively calculating semantic feature vectors corresponding to each paragraph by adopting a transducer model structure, and taking the semantic feature vectors as the semantic feature vectors of each paragraph in the first text;
searching texts with the semantic feature vector numerical value difference within a preset range from texts in a preset database as second texts, wherein the texts in the preset database are single-paragraph texts, and respectively inquiring the second texts similar to each paragraph in the first texts when the page presents a plurality of paragraphs;
taking the second text as a text to be recommended;
displaying the text to be recommended comprises the following steps: displaying the text to be recommended on one side of the first text, so that the text to be recommended can be read from one side of the first text; or, receiving a third touch control on the first paragraph of the first text or a preset button corresponding to the first paragraph, and displaying the text to be recommended corresponding to the first paragraph according to the third touch control.
2. The recommendation method of claim 1, wherein the obtaining the semantic feature vector of the first text comprises:
obtaining semantic feature vectors of each word according to character codes in the first text;
and obtaining the semantic feature vector of the first text according to the semantic feature vector of each word.
3. The recommendation method according to claim 2, wherein said deriving the semantic feature vector of the first text from the semantic feature vector of each word comprises:
and accumulating and averaging the semantic feature vectors of each word to obtain the semantic feature vector of the first text.
4. The recommendation method according to claim 2, wherein said deriving the semantic feature vector of the first text from the semantic feature vector of each word comprises:
the weight of the current general semantic feature vector and each word is obtained through the initial general semantic feature vector and each word semantic feature vector of the current sentence, and the semantic feature vector of the first text is obtained through the weight and each word semantic feature vector.
5. The recommendation method of claim 1, wherein said presenting said text to be recommended further comprises:
receiving a first touch control on the first text, and displaying the text to be recommended according to the first touch control; or (b)
And receiving a second touch control of a preset button corresponding to the first text, and displaying the text to be recommended according to the second touch control.
6. The recommendation method of claim 1, wherein said presenting said text to be recommended further comprises:
and counting the space of each paragraph, and displaying and recommending the text to be recommended corresponding to the paragraph with longer space in front.
7. A text recommendation device, comprising:
an acquisition unit including:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a first text presented by a current page which is being read by a user, the first text presented by the current page comprises at least two paragraphs, and the number of the paragraphs presented in the current page can change along with the reading of the user;
the paragraph splitting module is used for dividing the first text into paragraphs according to a preset rule;
the acquisition module is further used for acquiring semantic feature vectors corresponding to characters in the currently presented paragraphs when the current page presents only a single paragraph; when the current page presents a plurality of paragraphs at the same time, semantic feature vectors corresponding to texts in different paragraphs are respectively obtained;
the calculating module is used for calculating the semantic feature vector corresponding to the current paragraph to be used as the semantic feature vector of the first text according to the semantic feature vector corresponding to the text in the current paragraph to be presented by adopting a transducer model structure when the current page presents only a single paragraph; when the current page presents a plurality of paragraphs at the same time, a transducer model structure is adopted to respectively calculate semantic feature vectors corresponding to each paragraph and serve as the semantic feature vectors of each paragraph in the first text;
the query unit is used for searching texts with the semantic feature vector numerical value difference within a preset range from texts in a preset database as second texts, wherein the texts in the preset database are single-paragraph texts, and when the page presents a plurality of paragraphs, the second texts similar to each paragraph in the first texts are respectively queried;
the recommending unit is used for taking the second text as a text to be recommended;
the display unit is used for displaying the text to be recommended and comprises the following steps: displaying the text to be recommended on one side of the first text, so that the text to be recommended can be read from one side of the first text; or, receiving a third touch control on the first paragraph of the first text or a preset button corresponding to the first paragraph, and displaying the text to be recommended corresponding to the first paragraph according to the third touch control.
8. The recommendation device of claim 7, wherein the acquisition unit comprises:
the first vector acquisition module is used for obtaining the semantic feature vector of each word according to the character codes in the first text;
and the second vector acquisition module is used for acquiring the semantic feature vector of the first text according to the semantic feature vector of each word.
9. The recommendation device of claim 8, wherein the second vector obtaining module is specifically configured to average the semantic feature vector accumulation of each word to obtain a semantic feature vector of the first text.
10. The recommendation device of claim 8, wherein the second vector obtaining module is specifically configured to obtain weights of the current general semantic feature vector and each word from the initial general semantic feature vector and each word semantic feature vector of the current sentence, and obtain the semantic feature vector of the first text from the weights and each word semantic feature vector.
11. The recommendation device of claim 7, wherein the presentation unit further comprises:
the first display module is used for receiving first touch control on the first text and displaying the text to be recommended according to the first touch control; or (b)
And the second display unit is used for receiving second touch control of a preset button corresponding to the first text and displaying the text to be recommended according to the second touch control.
12. The recommendation device of claim 7, wherein the presentation unit further comprises:
and the fourth display module is used for counting the space of each paragraph and displaying the text to be recommended corresponding to the paragraph with longer space in front for recommendation.
13. A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the text recommendation method of any one of claims 1 to 6.
14. A text recommendation device, the device comprising a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; the program instructions, when executed, perform the text recommendation method of any one of claims 1 to 6.
CN201911164244.2A 2019-11-25 2019-11-25 Text recommendation method and device Active CN110929017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911164244.2A CN110929017B (en) 2019-11-25 2019-11-25 Text recommendation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911164244.2A CN110929017B (en) 2019-11-25 2019-11-25 Text recommendation method and device

Publications (2)

Publication Number Publication Date
CN110929017A CN110929017A (en) 2020-03-27
CN110929017B true CN110929017B (en) 2023-07-14

Family

ID=69851722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911164244.2A Active CN110929017B (en) 2019-11-25 2019-11-25 Text recommendation method and device

Country Status (1)

Country Link
CN (1) CN110929017B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010085874A1 (en) * 2009-01-27 2010-08-05 Kibboko, Inc. Recommender system for on-line articles and documents
CN109739974A (en) * 2018-12-29 2019-05-10 咪咕数字传媒有限公司 A kind of recommendation information acquisition methods and device, storage medium
CN110196941A (en) * 2018-07-24 2019-09-03 腾讯科技(深圳)有限公司 A kind of information recommended method, device, server and storage medium
CN110222154A (en) * 2019-06-10 2019-09-10 武汉斗鱼鱼乐网络科技有限公司 Similarity calculating method, server and storage medium based on text and semanteme

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567290B (en) * 2010-12-30 2015-01-14 百度在线网络技术(北京)有限公司 Method, device and equipment for expanding short text to be processed
CN104199874B (en) * 2014-08-20 2018-07-31 哈尔滨工程大学 A kind of webpage recommending method based on user browsing behavior
CN104239512B (en) * 2014-09-16 2017-06-06 电子科技大学 A kind of text recommends method
CN107704560B (en) * 2017-09-21 2021-02-23 星潮闪耀移动网络科技(中国)有限公司 Information recommendation method, device and equipment
CN109840321B (en) * 2017-11-29 2022-02-01 腾讯科技(深圳)有限公司 Text recommendation method and device and electronic equipment
CN109359183B (en) * 2018-10-11 2021-04-23 南京中孚信息技术有限公司 Duplicate checking method and device for text information and electronic equipment
CN110377686B (en) * 2019-07-04 2021-09-17 浙江大学 Address information feature extraction method based on deep neural network model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010085874A1 (en) * 2009-01-27 2010-08-05 Kibboko, Inc. Recommender system for on-line articles and documents
CN110196941A (en) * 2018-07-24 2019-09-03 腾讯科技(深圳)有限公司 A kind of information recommended method, device, server and storage medium
CN109739974A (en) * 2018-12-29 2019-05-10 咪咕数字传媒有限公司 A kind of recommendation information acquisition methods and device, storage medium
CN110222154A (en) * 2019-06-10 2019-09-10 武汉斗鱼鱼乐网络科技有限公司 Similarity calculating method, server and storage medium based on text and semanteme

Also Published As

Publication number Publication date
CN110929017A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
US10140368B2 (en) Method and apparatus for generating a recommendation page
CN108829808B (en) Page personalized sorting method and device and electronic equipment
US20190018900A1 (en) Method and Apparatus for Displaying Search Results
CN109522480B (en) Information recommendation method and device, electronic equipment and storage medium
US20180101616A1 (en) Search System, Page Display Method and Client Terminal
US8983930B2 (en) Facet group ranking for search results
CN103455524B (en) Method and device for displaying and acquiring entry information
GB2545311A (en) Attribute weighting for media content-based recommendation
CN107704560B (en) Information recommendation method, device and equipment
US20120330962A1 (en) Method and Apparatus of Providing Suggested Terms
WO2013138516A1 (en) Publishing product information
CN110990696B (en) Method and device for recommending search intention
US9330071B1 (en) Tag merging
JP6728178B2 (en) Method and apparatus for processing search data
CN111639255B (en) Recommendation method and device for search keywords, storage medium and electronic equipment
US20180060427A1 (en) Navigating a Taxonomy Using Search Queries
CN111061954B (en) Search result sorting method and device and storage medium
US20170228378A1 (en) Extracting topics from customer review search queries
KR20200049193A (en) Method for providing contents and service device supporting the same
CN112163149B (en) Method and device for recommending message
CN114329207A (en) Multi-service information sequencing system, method, storage medium and electronic equipment
CN110929017B (en) Text recommendation method and device
CN110136701B (en) Voice interaction service processing method, device and equipment
CN114677176A (en) Method and device for recommending interest content, electronic equipment and storage medium
CN114154064A (en) Commodity keyword optimization method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200728

Address after: 518000 Nanshan District science and technology zone, Guangdong, Zhejiang Province, science and technology in the Tencent Building on the 1st floor of the 35 layer

Applicant after: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Address before: 100029, Beijing, Chaoyang District new East Street, building No. 2, -3 to 25, 101, 8, 804 rooms

Applicant before: Tricorn (Beijing) Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant