WO2021017238A1 - Text generation method and apparatus - Google Patents

Text generation method and apparatus Download PDF

Info

Publication number
WO2021017238A1
WO2021017238A1 PCT/CN2019/115286 CN2019115286W WO2021017238A1 WO 2021017238 A1 WO2021017238 A1 WO 2021017238A1 CN 2019115286 W CN2019115286 W CN 2019115286W WO 2021017238 A1 WO2021017238 A1 WO 2021017238A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
text template
content
field
module
Prior art date
Application number
PCT/CN2019/115286
Other languages
French (fr)
Chinese (zh)
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 WO2021017238A1 publication Critical patent/WO2021017238A1/en

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

Definitions

  • the present disclosure relates to the field of network application technology, and in particular, to a text generation method and device.
  • News articles have the characteristics of timeliness, especially after the occurrence of hot events, various network platforms, radio and television, newspapers and magazines will rush to broadcast them in the first time to gain more traffic attention, ratings, etc., and provide small Editing brings greater creative pressure; soft-text articles refer to advertising articles in the form of text written by corporate promoters or advertising companies, compared with rigid advertisements, to increase the visibility of the company; or other types such as copywriting, advertising, etc.
  • the editor needs a series of tasks, including creative discovery before writing, thinking combing during writing, material search, grammar check after writing, originality evaluation, and completion of these tasks in a relatively short time Brings greater pressure to the creative editor.
  • the present disclosure provides a text generation method and device.
  • a text generation method including:
  • the target field is replaced with the target replaceable material.
  • a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
  • the method before the receiving the text editing trigger instruction, the method further includes:
  • the text template is determined.
  • the displaying at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template includes:
  • the preset correspondence between the keywords in the input content and the text template and based on the preset originality rules, display at least one text template associated with the input content in descending order of the originality of the text template .
  • the receiving user input content includes:
  • the method further includes:
  • the field of the text template is replaced with a history replacement field
  • the history replacement field includes fields whose replacement times in the user history are greater than a preset threshold.
  • it also includes:
  • it also includes:
  • the position that does not conform to the rule is marked.
  • the method further includes:
  • the correlation between the reference material and the text template is greater than a preset threshold.
  • it also includes:
  • displaying the content of the text template and marking the fields with replaceable materials in the content includes:
  • the method before the receiving the text editing trigger instruction, the method further includes:
  • a text generation device including:
  • the first receiving module is used to receive a trigger instruction for text editing
  • the first display module is configured to display the content of the text template in response to the trigger instruction, and mark the fields with replaceable materials in the content;
  • the generating module is configured to replace the target field with the target replaceable material according to the target replaceable material of the target field in the text template selected by the user.
  • a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
  • it also includes:
  • the second receiving module is used to receive user input
  • the second display module is configured to display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
  • the determination module is used to determine the text template according to the user's selection instruction.
  • the second display module includes:
  • the sorting sub-module is used to display the content related to the input content according to the preset corresponding relationship between the keywords in the input content and the text template, and based on the preset originality rule, according to the order of the originality of the text template from high to low At least one text template of the link.
  • the second receiving module includes:
  • the receiving sub-module is used to receive input content in multiple input boxes, and the multiple input boxes respectively correspond to different components of the article.
  • it also includes:
  • the third receiving module is used to receive a trigger instruction of one-key replacement of the control
  • the replacement module is configured to replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material, and the history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
  • it also includes:
  • the fourth receiving module is used to receive the trigger instruction of the syntax analysis control
  • the third display module is used to display the grammatical relationship between the fields of the replaceable material.
  • it also includes:
  • the judgment module is used to judge whether the target replaceable material meets the preset grammatical rules
  • the marking module is used for marking the position that does not conform to the rule if the target replaceable material does not conform to the grammatical rule.
  • it also includes:
  • the fourth display module is used to display reference materials, and the correlation between the reference materials and the text template is greater than a preset threshold.
  • it also includes:
  • the fifth receiving module is configured to receive the user's editing instruction on the reference material, and copy or replace the reference material to the designated position of the text template.
  • the first display module includes:
  • the display sub-module is used to display the content of the text template in segments in response to the trigger instruction, and mark the fields with replaceable materials in the content;
  • the adjustment sub-module is used to receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
  • it also includes:
  • Acquisition module used to acquire text data from multiple platforms
  • the word segmentation module performs word segmentation processing on the text data to determine the replaceable material.
  • a text generation device including:
  • a memory for storing processor executable instructions
  • the processor is configured to execute the method described in any embodiment of the present disclosure.
  • a non-transitory computer-readable storage medium including: when instructions in the storage medium are executed by a processor, the processor can execute any The method described in the embodiment.
  • the present disclosure provides fields for replaceable materials on a text template for users to select and modify, and by marking the fields for replaceable materials in the content, it is convenient for users to quickly discover Modify the target, and the replaceable material content contains the historical related information of the field, which is convenient for users to search and replace the material.
  • the function is displayed through a visual interface, which greatly improves the rate of text generation and saves text creation Labor costs.
  • Fig. 1 is an application scenario diagram of a text generation method according to an exemplary embodiment.
  • Fig. 2 is a flow chart showing a method for generating text according to an exemplary embodiment.
  • Fig. 3(a) is a schematic diagram showing an interface of a text generation method according to an exemplary embodiment.
  • Fig. 3(b) is a schematic diagram showing the interface of a text generation method according to an exemplary embodiment
  • Fig. 3(c) is a schematic diagram showing the interface of a text generation method according to an exemplary embodiment
  • Fig. 4 is a block diagram of a text generating device according to an exemplary embodiment.
  • Fig. 5 is a block diagram of a text generating device according to an exemplary embodiment.
  • Fig. 6 is a block diagram of a text generating device according to an exemplary embodiment.
  • the present disclosure provides a text generation method and device.
  • Fig. 1 is an application scene diagram of a text generation method according to an exemplary embodiment.
  • the application terminal 101 may be a smart phone, a tablet computer or other portable mobile terminal with a display function.
  • the application terminal 101 may also be a smart wearable device such as a smart watch or smart glasses, or a car navigation device.
  • the server 102 may be one server, or several servers, or a virtualization platform, or a cloud computing service center.
  • the application terminal 101 and the server 102 are connected through a communication network. After the application terminal 101 receives the editing instruction from the user, in response to the editing instruction, it sends an information acquisition request to the server, receives the information fed back by the server 102, and displays the feedback information on the display interface.
  • Fig. 2 is a method flowchart of an embodiment of a text generation method provided by the present disclosure.
  • the present disclosure provides method operation steps as shown in the following embodiments or drawings, more or less operation steps may be included in the method based on conventional or without creative labor. In steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiments of the present disclosure.
  • FIG. 2 An embodiment of the text generation method provided by the present disclosure is shown in FIG. 2.
  • the method includes:
  • Step S11 receiving a trigger instruction for text editing.
  • the text editing control can be set on the display interface, and the text editing command can be triggered by clicking on the control; the text editing command can also be triggered by voice control, for example,
  • the earpiece of the application terminal issues a voice instruction: "Hello Xiaobian, please open text editing!; you can also trigger text editing instructions through gestures, such as double-clicking the article you are browsing, sliding the article with a certain sliding rule, etc. Instruction that triggers text editing.
  • Step S12 in response to the trigger instruction, display the content of the text template, and mark the fields with replaceable materials in the content.
  • the text template that is, the text content that can be edited, may include the article being browsed, the article added to the favorites, the searched article, or the article input in the editing interface.
  • the text template includes fields for replaceable materials, and also includes fields for non-replaceable materials.
  • the fields for non-replaceable materials may include content input by the user.
  • the fields for replaceable materials may be single words, single words, or phrases.
  • the replaceable material corresponding to it can be a word, phrase, or phrase.
  • the field of the replaceable material is marked as having a different color from the field of the non-replaceable material. Further, after the field of the replaceable material is replaced, its color is marked with a color that is different from that before the replacement, with Record user actions.
  • Step S13 replacing the target field with the target replaceable material according to the target replaceable material in the target field in the text template selected by the user.
  • the content of the replaceable material may include synonyms that have similar meanings to the field of the replaceable material, as well as related material content, for example, when the field is a star, it is related to it.
  • the co-actor of can be used as replaceable material content; when the field is a certain basketball sport, related football, volleyball, and ice hockey sports can also be used as replaceable material content, and the appeal can be replaced.
  • the selection of materials is achieved through big data analysis, that is, the number of times the field and the replaceable materials appear at the same time is counted. When the number of times is greater than a preset threshold, it is considered to have a high correlation and can be used as the Replaceable material for the field.
  • the present disclosure provides fields of replaceable material on a text template for users to select and modify.
  • By marking the field of replaceable material in the content it is convenient for users to quickly find the modification target, and the content of the replaceable material includes the field
  • the historical related information is convenient for users to search and replace materials.
  • the function is displayed through a visual interface, which greatly improves the rate of text generation and saves the labor cost of text creation.
  • a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
  • the preset operation may include operations such as mouse clicking, or placing the mouse on the field for a preset time, or right-clicking the field to display the option to open the replaceable material.
  • the content of the replaceable material is displayed around the field. It is possible to further click the target replaceable material to realize the selection operation of the target replaceable material, and double-click to replace it. In this way, by setting a control on the field, the user can conveniently query the replaceable material content of the field, and replace it with the selected replaceable material with one click, saving manual input time.
  • step S11 before receiving a text editing trigger instruction, the method further includes:
  • Step S08 receiving the user's input content.
  • the input content may include keyword input, field input, sentence input, or even a paragraph input.
  • the more input content the closer the text template content provided by the server is to the user's creative theme.
  • after the user has entered the input content he clicks the corresponding input completion control to create a text template, or clicks a preset function key on the keyboard, such as "Enter" to complete the input operating.
  • Step S09 Display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template.
  • the server pre-stores the text data obtained from major network platforms, and establishes the corresponding relationship between keywords and text templates in advance.
  • the corresponding text template is retrieved, and further, you can select the location where the keyword exists, such as the title of the text template, the first paragraph of the text template, or the end of the text template , Or full text, etc., to achieve more accurate retrieval.
  • Step S10 Determine a text template according to the user's selection instruction.
  • the text template can be displayed in the form of a list, can also be displayed in a graphic manner, can display the title, author, release time and other information of the text template, and can also display the abstract or part of the text of the text template And other content to facilitate users to quickly browse the target text template.
  • the display page of each text template is provided with an edit control, and by triggering the edit control, the text template to be edited is determined.
  • the generation of the disclosed text template is closely related to the user's input content, and provides multiple text template displays for users to choose, which improves the correlation between the text template and the text subject to be created, and makes the final generated text more in line with the relevant subject , Strengthen the practical application.
  • the step S09 displaying at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template, includes:
  • the preset correspondence between the keywords in the input content and the text template and based on the preset originality rules, display at least one text template associated with the input content in descending order of the originality of the text template .
  • the originality rule includes: pre-comparing the text template with other related subject documents in the database, and the repetition rate in content can be measured from the number of repeated keywords, sentences, and paragraphs. According to the order of the repetition rate from high to low, the order of originality is determined, which can be set. The higher the repetition rate, the lower the originality.
  • the setting method of the originality rule is not limited to the above examples. Technical personnel may also make other changes under the enlightenment of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered by the protection scope of this application.
  • the server also pre-stores the text data obtained from major network platforms, and establishes the correspondence between keywords and text templates in advance, extracts the keyword information of the input content, and according to all The corresponding relationship between the keywords and the text template is described, and the corresponding text template is retrieved.
  • the text templates with higher originality are displayed in front of the text templates, so that users can find text templates with higher originality more quickly.
  • the step S08, receiving user input content includes:
  • the component parts of the article include the title of the article and the main body of the article.
  • the main body of the article may also include the first paragraph of the main body, the middle paragraph of the main body, and the last paragraph of the main body.
  • the corresponding relationship between the input box and the article components can be established, such as the title input box, the first paragraph input box, the middle text input box, etc., so that the text template containing the input content in the title input box in the title will be retrieved Similarly, the text template that contains the input content in the first paragraph of the text input box will be retrieved.
  • the database contains text templates obtained from major platforms. The structure of the text templates can be marked and indexed in advance to determine the first paragraph, the middle paragraph and the end paragraph of the text template.
  • input box options can also be established, such as drop-down icon controls.
  • the empty input options can include a title input box, an input box for the first paragraph of the text, an input box for the middle paragraph of the text, and an input box for the end of the text.
  • a text template can be automatically generated through a natural language model, such as GPT-2, based on user input in different input boxes.
  • the present disclosure categorizes input boxes corresponding to different components of the text template, so that the finally generated text is more in line with the requirements of users, and the practical applicability of the method is improved.
  • step S12 in response to the trigger instruction, the content of the text template is displayed, and the content field with replaceable material is marked. It also includes:
  • Step S14 receiving a trigger instruction to replace the control with one key
  • Step S15 Replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material.
  • the history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
  • the one-key replacement control instruction indicates that after the instruction is initiated, the field of the text template will be replaced with a history replacement field with one key, and the history replacement field includes that the number of replacements in the user history is greater than a preset threshold
  • the history replacement field includes that the number of replacements in the user history is greater than a preset threshold
  • the user's personal replacement preference can be reflected, and the text template can be replaced with the target text with one click, which is more convenient and rapid, and at the same time conforms to the user's personal preference.
  • the method further includes:
  • Step S16 receiving a trigger instruction of the syntax analysis control
  • Step S17 displaying the grammatical relationship between the fields of the replaceable material.
  • the grammatical relationship includes using the noise channel model in the natural language processing model to perform grammar detection, and can also be detected through a parse tree. It should be noted that the implementation of the grammatical relationship is not limited to the above examples. Those skilled in the art may also make other changes under the enlightenment of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they shall be covered by the protection scope of this application.
  • the present disclosure can perform grammatical detection on the replaced fields, facilitate users to find grammatical errors of the text, and improve the quality of text generation.
  • the method further includes:
  • Step S18 judging whether the target replaceable material meets a preset grammatical rule
  • Step S19 If the target replaceable material does not conform to the grammatical rule, mark the position that does not conform to the rule.
  • the target replaceable material does not conform to the preset grammatical rules, mark the position of the target replaceable material.
  • the marking method may include highlighted fields, underlines, wavy lines, etc. .
  • the language statistical model can be used for analysis. If the probability of the replaced sentence in the database is less than a certain threshold, the sentence is judged as not conforming to the grammatical rules, and the position of the sentence is marked .
  • step S11 after receiving a text editing trigger instruction, the method further includes:
  • step S20 the reference material is displayed, and the correlation between the reference material and the text template is greater than a preset threshold.
  • the referenceable materials include consulting articles, pictures, or expressions related to the text template or user input content, and the correlation between the referenceable materials and the text template can be achieved through statistical methods. For example, count the number of times the keywords and reference materials in the text template appear in the same article. If the number of times is greater than a preset threshold, the reference materials will be displayed. It should be noted that the display of the reference materials The implementation of is not limited to the above examples. It is also possible to display related reference materials by establishing the correspondence between text template keywords and reference materials. Those skilled in the art may also make other changes under the enlightenment of the technical essence of this application. , But as long as the functions and effects achieved are the same or similar to those of this application, they shall be covered by the scope of protection of this application.
  • the method further includes:
  • Step S21 Receive a user's editing instruction on the reference material, and copy or replace the reference material to a designated position of the text template.
  • the reference material can be added to the relative position of the text template by copying or replacing, which is convenient for users to modify the text template. In a possible way, it can also be dragged and transported.
  • the reference material is copied to the specified position of the text template.
  • the implementation of adding the reference material is not limited to the above examples. Those skilled in the art may also be enlightened by the technical essence of this application. Other changes are made, but as long as the functions and effects achieved are the same or similar to those of this application, they shall be covered by the scope of protection of this application.
  • the step S12 in response to the trigger instruction, displaying the content of the text template, and marking the field with replaceable material in the content, includes:
  • Step S121 In response to the triggering instruction, the content of the text template is displayed in segments, and the fields with replaceable materials in the content are marked.
  • Step S122 Receive a paragraph adjustment instruction from the user, and adjust the designated paragraph in the text template to a designated position.
  • the segmented display includes a sentence that can be displayed in a text template as an operation unit, and a paragraph in the text template can also be displayed as an operation unit. It should be noted that, When the number of words contained in the operating unit is smaller, the flexibility of editing the text template is greater.
  • the text template can also be segmented in other ways, which is not limited here.
  • an operation control can be set next to the text content of each paragraph, and the position of the text content of the paragraph can be adjusted by selecting the control, for example, the position replacement of two paragraphs can be realized by dragging.
  • the present disclosure displays text paragraphs in sections and has high flexibility.
  • the position adjustment of any paragraph in the text template is realized by setting operation controls, which is convenient for users to adjust freely.
  • the method before the receiving a text editing trigger instruction, the method further includes:
  • Step S22 obtaining text data from multiple platforms
  • Step S23 Perform word segmentation processing on the text data to determine the replaceable material.
  • the webpage content and text data of each platform can be captured in advance through the technical means of web crawlers, and the captured text data can be word segmented to establish the relationship between words and words, words and phrases, words and sentences.
  • Figs. 3(a) to 3(c) are schematic diagrams showing interfaces of a text generation method according to an exemplary embodiment.
  • the display interface contains input content in multiple input boxes, such as the article title input box 309, the article head input box 310, the article middle input box 311, and the question mark is in the end input box 312.
  • the text template that contains the input content in the title input box in the title will be retrieved.
  • the text template that contains the input content in the first paragraph of the body text input box will be retrieved.
  • FIG. 3(b) open a text template, click on the text editing trigger space 313 to enter the editing interface, refer to Figure 3(c), which shows the content of the text template, and mark that the content can be replaced The material field 301.
  • the interface is provided with a key replacement control 304 and a syntax analysis control 307. You can refer to materials such as information material 302, picture material 303, information material list 306, and display the contents of the text template in sections, as shown in Figure 3.
  • (c) a sentence is displayed as a paragraph unit.
  • An operation control 308 is set next to the text content of each paragraph. By selecting the control, the position of the text content of the paragraph can be adjusted, for example, by dragging. Realize the position replacement of two paragraphs.
  • Fig. 4 is a block diagram showing a text generating device according to an exemplary embodiment.
  • the device includes:
  • the first receiving module 11 is used to receive a text editing trigger instruction
  • the first display module 12 is configured to display the content of the text template in response to the trigger instruction, and mark the fields with replaceable materials in the content;
  • the generating module 13 is configured to replace the target field with the target replaceable material according to the target replaceable material of the target field in the text template selected by the user.
  • a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
  • it also includes:
  • the second receiving module is used to receive user input
  • the second display module is configured to display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
  • the determination module is used to determine the text template according to the user's selection instruction.
  • the second display module includes:
  • the sorting sub-module is used to display the content related to the input content according to the preset corresponding relationship between the keywords in the input content and the text template, and based on the preset originality rule, according to the order of the originality of the text template from high to low At least one text template of the link.
  • the second receiving module includes:
  • the receiving sub-module is used to receive input content in multiple input boxes, and the multiple input boxes respectively correspond to different components of the article.
  • it also includes:
  • the third receiving module is used to receive a trigger instruction of one-key replacement of the control
  • the replacement module is configured to replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material, and the history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
  • it also includes:
  • the fourth receiving module is used to receive the trigger instruction of the syntax analysis control
  • the third display module is used to display the grammatical relationship between the fields of the replaceable material.
  • it also includes:
  • the judgment module is used to judge whether the target replaceable material meets the preset grammatical rules
  • the marking module is used for marking the position that does not conform to the rule if the target replaceable material does not conform to the grammatical rule.
  • it also includes:
  • the fourth display module is used to display reference materials, and the correlation between the reference materials and the text template is greater than a preset threshold.
  • it also includes:
  • the fifth receiving module is configured to receive the user's editing instruction on the reference material, and copy or replace the reference material to the designated position of the text template.
  • the first display module includes:
  • the display sub-module is used to display the content of the text template in segments in response to the trigger instruction, and mark the fields with replaceable materials in the content;
  • the adjustment sub-module is used to receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
  • it also includes:
  • Acquisition module used to acquire text data from multiple platforms
  • the word segmentation module performs word segmentation processing on the text data to determine the replaceable material.
  • Fig. 5 is a block diagram showing a device 800 for generating text according to an exemplary embodiment.
  • the device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
  • the device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, And the communication component 816.
  • the processing component 802 generally controls the overall operations of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components.
  • the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
  • the memory 804 is configured to store various types of data to support operations in the device 800. Examples of these data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc.
  • the memory 804 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic Disk Magnetic Disk or Optical Disk.
  • the power supply component 806 provides power to various components of the device 800.
  • the power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
  • the multimedia component 808 includes a screen that provides an output interface between the device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC), and when the device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals.
  • the received audio signal may be further stored in the memory 804 or transmitted via the communication component 816.
  • the audio component 810 further includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 814 includes one or more sensors for providing the device 800 with various aspects of status assessment.
  • the sensor component 814 can detect the open/close state of the device 800 and the relative positioning of components.
  • the component is the display and the keypad of the device 800.
  • the sensor component 814 can also detect the position change of the device 800 or a component of the device 800. , The presence or absence of contact between the user and the device 800, the orientation or acceleration/deceleration of the device 800, and the temperature change of the device 800.
  • the sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices.
  • the device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof.
  • the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the apparatus 800 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing equipment (DSPD), programmable logic devices (PLD), field programmable A gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • ASIC application specific integrated circuits
  • DSP digital signal processors
  • DSPD digital signal processing equipment
  • PLD programmable logic devices
  • FPGA field programmable A gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • non-transitory computer-readable storage medium including instructions, such as the memory 804 including instructions, which can be executed by the processor 820 of the device 800 to complete the foregoing method.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
  • Fig. 6 is a block diagram showing a device 1900 for generating text according to an exemplary embodiment.
  • the device 1900 may be provided as a server.
  • the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs.
  • the application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to the network, and an input output (I/O) interface 1958.
  • the device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • non-transitory computer-readable storage medium including instructions, such as the memory 1932 including instructions, which may be executed by the processing component 1922 of the device 1900 to complete the foregoing method.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

Landscapes

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

Abstract

A text generation method and apparatus, comprising: receiving a trigger instruction for text editing (S11); in response to the trigger instruction, displaying content of a text template and tagging a field having a replaceable material in the content (S12); and according to a target replaceable material of a target field in the text template selected by a user, replacing the target field with the target replaceable material (S13). The field having the replaceable material is provided on the text template for selection and modification of the user; the field having the replaceable material is tagged in the content, thereby facilitating the user to quickly find a target to be modified; the replaceable material content comprises historical related information of the field, thereby facilitating the user to find a material and perform replacement. The functions are displayed via a visual interface, thereby greatly increasing the text generation rate, and saving the labor costs of text creation.

Description

一种文本生成方法和装置Method and device for generating text 技术领域Technical field
本公开涉及网络应用技术领域,尤其涉及一种文本生成方法和装置。The present disclosure relates to the field of network application technology, and in particular, to a text generation method and device.
背景技术Background technique
新闻类文章具有时效性的特点,尤其热点事件发生后,各个网络平台、广播电视、报刊杂志都会抢在第一时间播报,以获得更多的流量关注、收视率等,给各种媒体的小编带来较大的创作压力;软文文章是指相对于硬性广告而言,由企业宣传人员或广告公司撰写的文字形式的广告文章,以提高企业的知名度;抑或是其他类型如文案、广告等的文章,在进行创作时,都需要小编进行一系列的工作,包括写作前创意发觉、写作中思维梳理、素材查找,写作后的语法检查、原创度测评,在较短的时间完成这些工作给创作小编带来较大压力。News articles have the characteristics of timeliness, especially after the occurrence of hot events, various network platforms, radio and television, newspapers and magazines will rush to broadcast them in the first time to gain more traffic attention, ratings, etc., and provide small Editing brings greater creative pressure; soft-text articles refer to advertising articles in the form of text written by corporate promoters or advertising companies, compared with rigid advertisements, to increase the visibility of the company; or other types such as copywriting, advertising, etc. For the creation of the article, the editor needs a series of tasks, including creative discovery before writing, thinking combing during writing, material search, grammar check after writing, originality evaluation, and completion of these tasks in a relatively short time Brings greater pressure to the creative editor.
发明内容Summary of the invention
为克服相关技术中存在的问题,节省文章创作的人力成本,本公开提供一种文本生成方法和装置。In order to overcome the problems in the related technology and save the labor cost of article creation, the present disclosure provides a text generation method and device.
根据本公开实施例的第一方面,提供一种文本生成方法,包括:According to a first aspect of the embodiments of the present disclosure, there is provided a text generation method, including:
接收文本编辑的触发指令;Receive the trigger command for text editing;
响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段;In response to the triggering instruction, display the content of the text template, and mark the fields with replaceable materials in the content;
根据用户选择的所述文本模板中目标字段的目标可替换素材,将所述目标字段替换为所述目标可替换素材。According to the target replaceable material of the target field in the text template selected by the user, the target field is replaced with the target replaceable material.
在一种可能的实现方式中,所述字段上设置有控件,通过对所述控件进行预设操作,可展示所述字段的所述可替换素材。In a possible implementation manner, a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
在一种可能的实现方式中,在所述接收文本编辑的触发指令之前,还包括:In a possible implementation manner, before the receiving the text editing trigger instruction, the method further includes:
接收用户的输入内容;Receive user input;
根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板;Displaying at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
根据用户的选择指令,确定文本模板。According to the user's selection instruction, the text template is determined.
在一种可能的实现方式中,所述根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板,包括:In a possible implementation manner, the displaying at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template includes:
根据输入内容中的关键词与文本模板预设的对应关系,基于预设原创度规则,按照所述文本模板原创度由高到低的顺序,展示与所述输入内容相关联的至少一个文本模板。According to the preset correspondence between the keywords in the input content and the text template, and based on the preset originality rules, display at least one text template associated with the input content in descending order of the originality of the text template .
在一种可能的实现方式中,所述接收用户的输入内容,包括:In a possible implementation manner, the receiving user input content includes:
接收多个输入框中的输入内容,所述多个输入框分别对应于文章的不同组成部分。Receive input content in multiple input boxes, the multiple input boxes respectively corresponding to different components of the article.
在一种可能的实现方式中,在所述响应于所述触发指令,显示文本模板的内容,并标注所述内容中具有可替换素材的字段之后,还包括:In a possible implementation manner, after the response to the trigger instruction, the content of the text template is displayed, and the field of the content with replaceable material is marked, the method further includes:
接收一键替换控件的触发指令;Receive a trigger command to replace the control with one click;
根据用户历史可替换素材的字段的替换数据,将所述文本模板的所述字段替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段。According to the replacement data of the field of the user's historical replaceable material, the field of the text template is replaced with a history replacement field, and the history replacement field includes fields whose replacement times in the user history are greater than a preset threshold.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
接收语法分析控件的触发指令;Receive the trigger instruction of the syntax analysis control;
展示所述可替换素材的字段之间的语法关系。Show the grammatical relationship between the fields of the replaceable material.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
判断所述目标可替换素材是否符合预设的语法规则;Judging whether the target replaceable material complies with preset grammatical rules;
若所述目标可替换素材不符合所述语法规则,则标注出不符合规则的位置。If the target replaceable material does not conform to the grammatical rule, the position that does not conform to the rule is marked.
在一种可能的实现方式中,在所述接收文本编辑的触发指令之后还包括:In a possible implementation manner, after the receiving the text editing trigger instruction, the method further includes:
展示可参考素材,所述可参考素材与文本模板的相关性大于预设阈值。Displaying reference material, the correlation between the reference material and the text template is greater than a preset threshold.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
接收用户关于所述可参考素材的编辑指令,将所述可参考素材复制或替换到所述文本模板的指定位置。Receive a user's editing instruction on the referenceable material, and copy or replace the referenceable material to a designated position of the text template.
在一种可能的实现方式中,响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段,包括:In a possible implementation manner, in response to the trigger instruction, displaying the content of the text template and marking the fields with replaceable materials in the content includes:
响应于所述触发指令,分段展示文本模板的内容,并标注所述内容中具有可替换素材的字段;In response to the trigger instruction, display the content of the text template in segments, and mark the fields with replaceable materials in the content;
接收用户段落调整的指令,将所述文本模板中的指定段落调整至指定位置。Receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
在一种可能的实现方式中,在所述接收文本编辑的触发指令之前还包括:In a possible implementation manner, before the receiving the text editing trigger instruction, the method further includes:
从多个平台获取文本数据;Obtain text data from multiple platforms;
对所述文本数据进行分词处理,确定所述可替换素材。Perform word segmentation processing on the text data to determine the replaceable material.
根据本公开实施例的第二方面,提供一种文本生成装置,包括:According to a second aspect of the embodiments of the present disclosure, there is provided a text generation device, including:
第一接收模块,用于接收文本编辑的触发指令;The first receiving module is used to receive a trigger instruction for text editing;
第一展示模块,用于响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段;The first display module is configured to display the content of the text template in response to the trigger instruction, and mark the fields with replaceable materials in the content;
生成模块,用于根据用户选择的所述文本模板中目标字段的目标可替换素材,将所述目标字段替换为所述目标可替换素材。The generating module is configured to replace the target field with the target replaceable material according to the target replaceable material of the target field in the text template selected by the user.
在一种可能的实现方式中,所述字段上设置有控件,通过对所述控件进行预设操作,可展示所述字段的所述可替换素材。In a possible implementation manner, a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第二接收模块,用于接收用户的输入内容;The second receiving module is used to receive user input;
第二展示模块,用于根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板;The second display module is configured to display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
确定模块,用于根据用户的选择指令,确定文本模板。The determination module is used to determine the text template according to the user's selection instruction.
在一种可能的实现方式中,所述第二展示模块包括:In a possible implementation manner, the second display module includes:
排序子模块,用于根据输入内容中的关键词与文本模板预设的对应关系,基于预设原创度规则,按照所述文本模板原创度由高到低的顺序,展示与所述输入内容相关联的至少一个文本模板。The sorting sub-module is used to display the content related to the input content according to the preset corresponding relationship between the keywords in the input content and the text template, and based on the preset originality rule, according to the order of the originality of the text template from high to low At least one text template of the link.
在一种可能的实现方式中,所述第二接收模块包括:In a possible implementation manner, the second receiving module includes:
接收子模块,用于接收多个输入框中的输入内容,所述多个输入框分别对应于文章的不同组成部分。The receiving sub-module is used to receive input content in multiple input boxes, and the multiple input boxes respectively correspond to different components of the article.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第三接收模块,用于接收一键替换控件的触发指令;The third receiving module is used to receive a trigger instruction of one-key replacement of the control;
替换模块,用于根据用户历史可替换素材的字段的替换数据,将所述文本模板的所述字段替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段。The replacement module is configured to replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material, and the history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第四接收模块,用于接收语法分析控件的触发指令;The fourth receiving module is used to receive the trigger instruction of the syntax analysis control;
第三展示模块,用于展示所述可替换素材的字段之间的语法关系。The third display module is used to display the grammatical relationship between the fields of the replaceable material.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
判断模块,用于判断所述目标可替换素材是否符合预设的语法规则The judgment module is used to judge whether the target replaceable material meets the preset grammatical rules
标注模块,用于若所述目标可替换素材不符合所述语法规则,则标注出不符合规则的位置。The marking module is used for marking the position that does not conform to the rule if the target replaceable material does not conform to the grammatical rule.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第四展示模块,用于展示可参考素材,所述可参考素材与文本模板的相关性大于预设阈值。The fourth display module is used to display reference materials, and the correlation between the reference materials and the text template is greater than a preset threshold.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第五接收模块,用于接收用户关于所述可参考素材的编辑指令,将所述可参考素材复制或替换到所述文本模板的指定位置。The fifth receiving module is configured to receive the user's editing instruction on the reference material, and copy or replace the reference material to the designated position of the text template.
在一种可能的实现方式中,所述第一展示模块包括:In a possible implementation manner, the first display module includes:
展示子模块,用于响应于所述触发指令,分段展示文本模板的内容,并标注所述内容中具有可替换素材的字段;The display sub-module is used to display the content of the text template in segments in response to the trigger instruction, and mark the fields with replaceable materials in the content;
调整子模块,用于接收用户段落调整的指令,将所述文本模板中的指定段落调整至指定位置。The adjustment sub-module is used to receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
获取模块,用于从多个平台获取文本数据;Acquisition module, used to acquire text data from multiple platforms;
分词模块,对所述文本数据进行分词处理,确定所述可替换素材。The word segmentation module performs word segmentation processing on the text data to determine the replaceable material.
根据本公开实施例的第三方面,提供一种文本生成装置,包括:According to a third aspect of the embodiments of the present disclosure, there is provided a text generation device, including:
处理器;processor;
用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
其中,所述处理器被配置为执行本公开任一实施例所述的方法。Wherein, the processor is configured to execute the method described in any embodiment of the present disclosure.
根据本公开实施例的第三方面,提供一种一种非临时性计算机可读存储介质,包括:当所述存储介质中的指令由处理器执行时,使得处理器能够执行根据本公开任一实施例所述的方法。According to a third aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, including: when instructions in the storage medium are executed by a processor, the processor can execute any The method described in the embodiment.
本公开的实施例提供的技术方案可以包括以下有益效果:本公开通过在文本模板上提供可替换素材的字段,供用户进行选择修改,通过在内容中标注可替换素材的字段,便于用户快速发现修改目标,且所述可替换素材内容包含了所述字段的历史相关信息,便于用户进行素材查找和替换,所述功能通过可视化的界面进行展示,大大提高了文本的生成速率,节省了文本创作的人力成本。The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: the present disclosure provides fields for replaceable materials on a text template for users to select and modify, and by marking the fields for replaceable materials in the content, it is convenient for users to quickly discover Modify the target, and the replaceable material content contains the historical related information of the field, which is convenient for users to search and replace the material. The function is displayed through a visual interface, which greatly improves the rate of text generation and saves text creation Labor costs.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments in accordance with the disclosure, and together with the specification are used to explain the principle of the disclosure.
图1是根据一示例性实施例示出的一种文本生成方法的应用场景图。Fig. 1 is an application scenario diagram of a text generation method according to an exemplary embodiment.
图2是根据一示例性实施例示出的一种文本生成方法的流程图。Fig. 2 is a flow chart showing a method for generating text according to an exemplary embodiment.
图3(a)是根据一示例性实施例示出的文本生成方法的界面示意图。Fig. 3(a) is a schematic diagram showing an interface of a text generation method according to an exemplary embodiment.
图3(b)是根据一示例性实施例示出的文本生成方法的界面示意图Fig. 3(b) is a schematic diagram showing the interface of a text generation method according to an exemplary embodiment
图3(c)是根据一示例性实施例示出的文本生成方法的界面示意图Fig. 3(c) is a schematic diagram showing the interface of a text generation method according to an exemplary embodiment
图4是根据一示例性实施例示出的文本生成装置的框图。Fig. 4 is a block diagram of a text generating device according to an exemplary embodiment.
图5是根据一示例性实施例示出的文本生成装置的框图。Fig. 5 is a block diagram of a text generating device according to an exemplary embodiment.
图6是根据一示例性实施例示出的文本生成装置的框图。Fig. 6 is a block diagram of a text generating device according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
为了方便本领域技术人员理解本公开实施例提供的技术方案,下面先对技术方案实现的技术环境进行说明。In order to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present disclosure, the following first describes the technical environment implemented by the technical solutions.
随着网络技术的快速发展,人们接触新闻资讯的方式不仅仅依靠报刊杂志,更多的信息数据来源于网络的各个应用平台,人类进入了信息化时代。不论是新闻类的文章还是软文广告类文章,抑或是创意文案等,在进行写作前,均需要小编进行一系列的工作,包括写作前创意发觉、写作中思维梳理、素材查找,写作后的语法检查、原创度测评,信息化时代,需要在较短的时间完成这些工作,给创作小编带来较大压力。相关技术中,一些人工智能的语言模型应运而生,这些语言模型虽然能实现给定一段话,续写一篇文章的功能,但续写的文章与作者的主题立意较远,作者对生成文章的把控度不高,难以获得实际应用。With the rapid development of network technology, the way people contact news and information does not only rely on newspapers and magazines, more information and data come from various application platforms on the Internet, and mankind has entered the information age. Whether it’s news articles, advertisment articles, or creative copywriting, the editor needs to do a series of tasks before writing, including creative discovery before writing, thinking combing during writing, material search, and post-writing Grammar check, originality evaluation, and the information age need to complete these tasks in a relatively short time, which brings greater pressure to the creative editor. In related technologies, some artificial intelligence language models have emerged. Although these language models can realize the function of writing an article for a given paragraph, the continued article is far from the author’s theme, and the author is more interested in generating articles. The degree of control is not high, and it is difficult to obtain practical applications.
基于类似于上文的实际技术需求,本公开提供了一种文本生成方法和装置。Based on actual technical requirements similar to the above, the present disclosure provides a text generation method and device.
图1是根据一示例性的实施例示出的一种文本生成方法的应用场景图。参考图1所示,应用终端101可以是具有显示功能的智能手机、平板电脑或其他便携式移动终端,所述应用终端101还可以是智能手表或者智能眼镜等智能可穿戴设备,或者车载导航设备。服务器102可以是一台服务器,或者 若干台服务器,或虚拟化平台,或云计算服务中心。所述应用终端101和服务器102通过通信网络相连接。应用终端101接收到用户的编辑指令后,响应于所述编辑指令,向服务器发送信息获取请求,接收服务器102反馈的信息,将反馈信息显示在显示界面上。Fig. 1 is an application scene diagram of a text generation method according to an exemplary embodiment. As shown in FIG. 1, the application terminal 101 may be a smart phone, a tablet computer or other portable mobile terminal with a display function. The application terminal 101 may also be a smart wearable device such as a smart watch or smart glasses, or a car navigation device. The server 102 may be one server, or several servers, or a virtualization platform, or a cloud computing service center. The application terminal 101 and the server 102 are connected through a communication network. After the application terminal 101 receives the editing instruction from the user, in response to the editing instruction, it sends an information acquisition request to the server, receives the information fed back by the server 102, and displays the feedback information on the display interface.
下面结合附图2对本公开所述的文本生成方法进行详细的说明。图2是本公开提供的文本生成方法的一种实施例的方法流程图。虽然本公开提供了如下述实施例或附图所示的方法操作步骤,但基于常规或者无需创造性的劳动在所述方法中可以包括更多或者更少的操作步骤。在逻辑性上不存在必要因果关系的步骤中,这些步骤的执行顺序不限于本公开实施例提供的执行顺序。The text generation method described in the present disclosure will be described in detail below with reference to FIG. 2. Fig. 2 is a method flowchart of an embodiment of a text generation method provided by the present disclosure. Although the present disclosure provides method operation steps as shown in the following embodiments or drawings, more or less operation steps may be included in the method based on conventional or without creative labor. In steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiments of the present disclosure.
具体的,本公开提供的文本生成方法一种实施例如图2所示,所述方法包括:Specifically, an embodiment of the text generation method provided by the present disclosure is shown in FIG. 2. The method includes:
步骤S11,接收文本编辑的触发指令。Step S11, receiving a trigger instruction for text editing.
本公开实施例中,可以通过在显示界面上设置文本编辑的控件,通过点击所述控件,以触发文本编辑的指令;还可以通过语音控制的方式,触发文本编辑的指令,比如,向安装于应用终端的听筒发出语音指示:“小编你好,请打开文本编辑!”;还可以通过手势等方式触发文本编辑的指令,比如,双击正在浏览的文章,以某种滑动规则滑动文章等,触发文本编辑的指令。In the embodiments of the present disclosure, the text editing control can be set on the display interface, and the text editing command can be triggered by clicking on the control; the text editing command can also be triggered by voice control, for example, The earpiece of the application terminal issues a voice instruction: "Hello Xiaobian, please open text editing!"; you can also trigger text editing instructions through gestures, such as double-clicking the article you are browsing, sliding the article with a certain sliding rule, etc. Instruction that triggers text editing.
步骤S12,响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段。Step S12, in response to the trigger instruction, display the content of the text template, and mark the fields with replaceable materials in the content.
本公开实施例中,所述文本模板,即可编辑的文本内容,可以包括正在浏览的文章,加入收藏夹中的文章,搜索到的文章,或在编辑界面内输入的文章等。所述文本模板中包括可替换素材的字段,还包括不可替换素材的字段,所述不可替换素材的字段可以包括用户输入的内容,所述可替换素材的字段,可以单个字、单个词、短语作为单位,与之相对应的可替换素材可以是字、词或短语等。所述可替换素材的字段被标记为与不可替换素材的字段具有相区分的颜色,进一步的,当所述可替换素材的字段被替换之后,其颜色与替换前具有相区分的颜色标记,以记录用户的操作。In the embodiment of the present disclosure, the text template, that is, the text content that can be edited, may include the article being browsed, the article added to the favorites, the searched article, or the article input in the editing interface. The text template includes fields for replaceable materials, and also includes fields for non-replaceable materials. The fields for non-replaceable materials may include content input by the user. The fields for replaceable materials may be single words, single words, or phrases. As a unit, the replaceable material corresponding to it can be a word, phrase, or phrase. The field of the replaceable material is marked as having a different color from the field of the non-replaceable material. Further, after the field of the replaceable material is replaced, its color is marked with a color that is different from that before the replacement, with Record user actions.
步骤S13,根据用户选择的所述文本模板中目标字段的目标可替换素材,将所述目标字段替换为所述目标可替换素材。Step S13, replacing the target field with the target replaceable material according to the target replaceable material in the target field in the text template selected by the user.
本公开实施例中,可替换素材的内容可以包括与所述可替换素材的字段词义相近的近义词,还包括与之相关的素材内容,比如,当所述字段是某个明星时,与之相关的合作演员可以作为为可替换素材内容;当所述字段是某个篮球运动项目时,与之相关的足球运动项目、排球运动项目、冰球运动项目也可以作为可替换素材的内容,上诉可替换素材的选取是通过大数据分析实现的,即统计所述字段与可替换素材同时出现的频率次数,当所述次数大于预设阈值时,被却认为具有较高的相关性,可以作为所述字段的可替换素材。In the embodiments of the present disclosure, the content of the replaceable material may include synonyms that have similar meanings to the field of the replaceable material, as well as related material content, for example, when the field is a star, it is related to it. The co-actor of can be used as replaceable material content; when the field is a certain basketball sport, related football, volleyball, and ice hockey sports can also be used as replaceable material content, and the appeal can be replaced The selection of materials is achieved through big data analysis, that is, the number of times the field and the replaceable materials appear at the same time is counted. When the number of times is greater than a preset threshold, it is considered to have a high correlation and can be used as the Replaceable material for the field.
本公开通过在文本模板上提供可替换素材的字段,供用户进行选择修改,通过在内容中标注可替换素材的字段,便于用户快速发现修改目标,且所述可替换素材内容包含了所述字段的历史相关信息,便于用户进行素材查找和替换,所述功能通过可视化的界面进行展示,大大提高了文本的生成速率,节省了文本创作的人力成本。The present disclosure provides fields of replaceable material on a text template for users to select and modify. By marking the field of replaceable material in the content, it is convenient for users to quickly find the modification target, and the content of the replaceable material includes the field The historical related information is convenient for users to search and replace materials. The function is displayed through a visual interface, which greatly improves the rate of text generation and saves the labor cost of text creation.
在一种可能的实现方式中,所述字段上设置有控件,通过对所述控件进行预设操作,可展示所述 字段的所述可替换素材。In a possible implementation manner, a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
本公开实施例中,所述预设操作,可以包括如鼠标点击、或鼠标放在所述字段上停留预设时间、或者右击所述字段,展示打开可替换素材的选项等操作,当进行所述预设操作时,在所述字段的周围展示所述可替换素材的内容。可以通过进一步的点击所述目标可替换素材,实现对目标可替换素材的选中操作,双击进行替换。这样通过对所述字段上设置控件,可以让用户方便的查询到所述字段的可替换素材内容,并一键替换到所选中的可替换素材,节省了手动输入的时间。In the embodiment of the present disclosure, the preset operation may include operations such as mouse clicking, or placing the mouse on the field for a preset time, or right-clicking the field to display the option to open the replaceable material. During the preset operation, the content of the replaceable material is displayed around the field. It is possible to further click the target replaceable material to realize the selection operation of the target replaceable material, and double-click to replace it. In this way, by setting a control on the field, the user can conveniently query the replaceable material content of the field, and replace it with the selected replaceable material with one click, saving manual input time.
在一种可能的实现方式中,在步骤S11,接收文本编辑的触发指令之前还包括:In a possible implementation manner, in step S11, before receiving a text editing trigger instruction, the method further includes:
步骤S08,接收用户的输入内容。Step S08, receiving the user's input content.
本公开实施例中,所述输入内容可以包括关键词输入、字段输入、句子输入、甚至一段话输入,输入的内容越多,服务器提供的文本模板内容就越接近于用户的创作主题。在一种可能的实现方式中,用户输入完所述输入内容后,通过点击相应的完成输入的控件进行文本模板的创建,或者点击键盘上预设功能键,如“回车键”,完成输入操作。In the embodiment of the present disclosure, the input content may include keyword input, field input, sentence input, or even a paragraph input. The more input content, the closer the text template content provided by the server is to the user's creative theme. In a possible implementation manner, after the user has entered the input content, he clicks the corresponding input completion control to create a text template, or clicks a preset function key on the keyboard, such as "Enter" to complete the input operating.
步骤S09,根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板。Step S09: Display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template.
本公开实时例中,服务器中预先存储了从各大网络平台获取的文本数据,并预先建立关键词与文本模板的对应关系,通过提取输入内容的各关键词信息,以及根据所述关键词与文本模板的对应关系,检索到对应的文本模板,进一步的,可以选取关键词存在的位置,比如出现在文本模板的标题、还是出现在文本模板的首段部分或者是出现在文本模板的末端部分,或者是全文等,实现更为精准的检索。In the real-time example of the present disclosure, the server pre-stores the text data obtained from major network platforms, and establishes the corresponding relationship between keywords and text templates in advance. By extracting each keyword information of the input content, and according to the keywords and Correspondence of the text template, the corresponding text template is retrieved, and further, you can select the location where the keyword exists, such as the title of the text template, the first paragraph of the text template, or the end of the text template , Or full text, etc., to achieve more accurate retrieval.
步骤S10,根据用户的选择指令,确定文本模板。Step S10: Determine a text template according to the user's selection instruction.
本公开实施例中,所述文本模板可以通过列表的方式展示、还可以通过图文方式展示、可以展示文本模板的标题、作者、发布时间等信息,还可以展示文本模板的摘要、或部分正文等内容,以方便用户快速浏览目标文本模板。可以在所述文本模板上设置控件,如超链接,通过点击所述超链接打开所述文本模板,当然,打开所述文本模板可以看到关于所述文本模板更为详细的内容信息,但并不表示选择了该文本模板,可以通过返回设置,返回到文本模板的搜索展示页。每一个文本模板的展示页面均设有编辑控件,通过触发所述编辑控件,确定需要编辑的文本模板。In the embodiment of the present disclosure, the text template can be displayed in the form of a list, can also be displayed in a graphic manner, can display the title, author, release time and other information of the text template, and can also display the abstract or part of the text of the text template And other content to facilitate users to quickly browse the target text template. You can set controls on the text template, such as a hyperlink, and open the text template by clicking on the hyperlink. Of course, you can see more detailed content information about the text template by opening the text template. It does not mean that the text template is selected, and you can return to the search display page of the text template by returning to the settings. The display page of each text template is provided with an edit control, and by triggering the edit control, the text template to be edited is determined.
本公开文本模板的生成是与用户的输入内容密切相关,并提供多个文本模板展示,供用户选择,提高了文本模板与待创作的文本主题的相关度,使得最终生成的文本更加符合相关主题,加强了实际应用。The generation of the disclosed text template is closely related to the user's input content, and provides multiple text template displays for users to choose, which improves the correlation between the text template and the text subject to be created, and makes the final generated text more in line with the relevant subject , Strengthen the practical application.
在一种可能的实现方式中,所述步骤S09,根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板,包括:In a possible implementation manner, the step S09, displaying at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template, includes:
根据输入内容中的关键词与文本模板预设的对应关系,基于预设原创度规则,按照所述文本模板原创度由高到低的顺序,展示与所述输入内容相关联的至少一个文本模板。According to the preset correspondence between the keywords in the input content and the text template, and based on the preset originality rules, display at least one text template associated with the input content in descending order of the originality of the text template .
本公开实施例中,所述原创度规则,包括:通过预先比较文本模板与数据库中其它相关主题文献,在内容上的重复率,可以从重复的关键词、句子、段落的字数作为计量单位,按照重复率由高到低的 顺序,确定原创度的排序,可以设定,重复率越高,原创度越小,需要说明的是,所述原创度规则的设置方式不限于上述举例,所属领域技术人员在本申请技术精髓的启示下,还可能做出其它变更,但只要其实现的功能和效果与本申请相同或相似,均应涵盖于本申请保护范围内。与上述实施例相一致的是,服务器中同样预先存储了从各大网络平台获取的文本数据,并预先建立关键词与文本模板的对应关系,通过提取输入内容的各关键词信息,以及根据所述关键词与文本模板的对应关系,检索到对应的文本模板。In the embodiment of the present disclosure, the originality rule includes: pre-comparing the text template with other related subject documents in the database, and the repetition rate in content can be measured from the number of repeated keywords, sentences, and paragraphs. According to the order of the repetition rate from high to low, the order of originality is determined, which can be set. The higher the repetition rate, the lower the originality. It should be noted that the setting method of the originality rule is not limited to the above examples. Technical personnel may also make other changes under the enlightenment of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they should be covered by the protection scope of this application. Consistent with the above-mentioned embodiment, the server also pre-stores the text data obtained from major network platforms, and establishes the correspondence between keywords and text templates in advance, extracts the keyword information of the input content, and according to all The corresponding relationship between the keywords and the text template is described, and the corresponding text template is retrieved.
通过建立原创度排序,将原创度较高的文本模板展示文本模板的前面,便于用户更快查找到原创度较高的文本模板。By establishing an originality ranking, the text templates with higher originality are displayed in front of the text templates, so that users can find text templates with higher originality more quickly.
在一种可能的实现方式中,所述步骤S08,接收用户的输入内容,包括:In a possible implementation, the step S08, receiving user input content, includes:
接收多个输入框中的输入内容,所述多个输入框分别对应于文章的不同组成部分。Receive input content in multiple input boxes, the multiple input boxes respectively corresponding to different components of the article.
本公开实施例中,所述文章的组成部分包括文章的标题、文章的正文,所述文章正文还可以包括,正文首段、正文中段、和正文末段。可以建立输入框与文章组成部分的对应关系,比如,标题输入框、正文首段输入框、正文中段输入框等,这样,在标题包含标题输入框中的输入内容的文本模板将会被检索到,类似的,在正文首段包含正文首段输入框中的输入内容的文本模板将会被检索到。数据库中包含了从各大平台获取的文本模板,可以预先对文本模板的结构进行标记索引,以确定文本模板的正文首段、正文中段和正文末段。在一种可能的实现方式中,还可以建立输入框选项,比如下拉图标控件等,输入空选项可以包括标题输入框、正文首段输入框、正文中段输入框、正文末段输入框等。在一种可能的实现方式中,可以结合用户在不同输入框中的输入内容,通过自然语言模型,如GPT-2自动生成文本模板。In the embodiment of the present disclosure, the component parts of the article include the title of the article and the main body of the article. The main body of the article may also include the first paragraph of the main body, the middle paragraph of the main body, and the last paragraph of the main body. The corresponding relationship between the input box and the article components can be established, such as the title input box, the first paragraph input box, the middle text input box, etc., so that the text template containing the input content in the title input box in the title will be retrieved Similarly, the text template that contains the input content in the first paragraph of the text input box will be retrieved. The database contains text templates obtained from major platforms. The structure of the text templates can be marked and indexed in advance to determine the first paragraph, the middle paragraph and the end paragraph of the text template. In a possible implementation, input box options can also be established, such as drop-down icon controls. The empty input options can include a title input box, an input box for the first paragraph of the text, an input box for the middle paragraph of the text, and an input box for the end of the text. In a possible implementation manner, a text template can be automatically generated through a natural language model, such as GPT-2, based on user input in different input boxes.
本公开通过对输入框进行分类,对应于文本模板的不同的组成部分,使得最终生成的文本更符合用户的要求,提高了本方法的实际应用性。The present disclosure categorizes input boxes corresponding to different components of the text template, so that the finally generated text is more in line with the requirements of users, and the practical applicability of the method is improved.
在一种可能的实现方式中,在所述步骤S12,响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段。之后还包括:In a possible implementation manner, in the step S12, in response to the trigger instruction, the content of the text template is displayed, and the content field with replaceable material is marked. It also includes:
步骤S14,接收一键替换控件的触发指令;Step S14, receiving a trigger instruction to replace the control with one key;
步骤S15,根据用户历史可替换素材的字段的替换数据,将所述文本模板的所述字段替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段。Step S15: Replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material. The history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
本公开实施例中,一键替换控件指令表示该指令被出发后,文本模板的所述字段将会一键被替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段,通过监测用户的替换行为,记录用户字段的替换结构,保存到数据库中,若历史替换次数大于预设阈值时,当前字段以及即将替换掉的字段的对应关系将被数据库记录下来,即将替换掉的字段被标记为当前字段的历史替换字段。In the embodiment of the present disclosure, the one-key replacement control instruction indicates that after the instruction is initiated, the field of the text template will be replaced with a history replacement field with one key, and the history replacement field includes that the number of replacements in the user history is greater than a preset threshold By monitoring the user’s replacement behavior, recording the replacement structure of the user’s field, and saving it in the database. If the number of historical replacements is greater than the preset threshold, the corresponding relationship between the current field and the field to be replaced will be recorded by the database, that is The replaced field is marked as the historical replacement field of the current field.
通过对历史替换字段的记录,可以体现用户的个人替换偏好,将文本模板一键替换成目标文本,更为便捷迅速,同时又符合用户的个人偏好。By recording the historical replacement field, the user's personal replacement preference can be reflected, and the text template can be replaced with the target text with one click, which is more convenient and rapid, and at the same time conforms to the user's personal preference.
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
步骤S16,接收语法分析控件的触发指令;Step S16, receiving a trigger instruction of the syntax analysis control;
步骤S17,展示所述可替换素材的字段之间的语法关系。Step S17, displaying the grammatical relationship between the fields of the replaceable material.
本公开实施例中,所述语法关系包括利用自然语言处理模型中的噪声信道模型进行语法检测还可以通过分析树进行检测等,需要说明的是,所述语法关系的实现方式不限于上述举例,所属领域技术人员在本申请技术精髓的启示下,还可能做出其它变更,但只要其实现的功能和效果与本申请相同或相似,均应涵盖于本申请保护范围内。In the embodiments of the present disclosure, the grammatical relationship includes using the noise channel model in the natural language processing model to perform grammar detection, and can also be detected through a parse tree. It should be noted that the implementation of the grammatical relationship is not limited to the above examples. Those skilled in the art may also make other changes under the enlightenment of the technical essence of this application, but as long as the functions and effects achieved are the same or similar to those of this application, they shall be covered by the protection scope of this application.
本公开通过设置语法分析功能,能够对替换后的字段进行语法检测,便于用户发现文本的语法错误,提高了文本的生成质量。By setting the syntax analysis function, the present disclosure can perform grammatical detection on the replaced fields, facilitate users to find grammatical errors of the text, and improve the quality of text generation.
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
步骤S18,判断所述目标可替换素材是否符合预设的语法规则;Step S18, judging whether the target replaceable material meets a preset grammatical rule;
步骤S19,若所述目标可替换素材不符合所述语法规则,则标注出不符合规则的位置。Step S19: If the target replaceable material does not conform to the grammatical rule, mark the position that does not conform to the rule.
本公开实施例中,若目标可替换素材不符合预设的语法规则,在则所述目标可替换素材的位置处,进行标注,所述标注方法,可以包括高亮字段、下划线、波浪线等。在一种可能的实现方式中,可以通过语言统计模型进行分析,若替换后的句子在数据库中出现的概率小于一定阈值,则上述句子被判定为不符合语法规则,则对上述句子位置进行标注。通过对这个不符合规则的目标可替换素材的进行标注,使得用户更容易发现文本的语法错误,提高文本的生成质量。In the embodiment of the present disclosure, if the target replaceable material does not conform to the preset grammatical rules, mark the position of the target replaceable material. The marking method may include highlighted fields, underlines, wavy lines, etc. . In a possible implementation, the language statistical model can be used for analysis. If the probability of the replaced sentence in the database is less than a certain threshold, the sentence is judged as not conforming to the grammatical rules, and the position of the sentence is marked . By labeling the replaceable material for this non-compliant target, it makes it easier for users to find grammatical errors in the text and improve the quality of text generation.
在一种可能的实现方式中,在步骤S11,接收文本编辑的触发指令之后还包括:In a possible implementation manner, in step S11, after receiving a text editing trigger instruction, the method further includes:
步骤S20,展示可参考素材,所述可参考素材与文本模板的相关性大于预设阈值。In step S20, the reference material is displayed, and the correlation between the reference material and the text template is greater than a preset threshold.
本公开实施例中,所述可参考素材包括与文本模板或用户输入内容相关的咨询类文章,或图片、或表情等,所述可参考素材与文本模板的相关性可以通过统计的方法实现,如统计文本模板中的关键词与可参考素材出现在同一片文章的次数,若所述次数大于预设阈值时,则展示所述可参考素材,需要说明的是,所述可参考素材的展示的实现方式不限于上述举例,还可以通过建立文本模板关键词与可参考素材的对应关系,展示相关的可参考素材,所属领域技术人员在本申请技术精髓的启示下,还可能做出其它变更,但只要其实现的功能和效果与本申请相同或相似,均应涵盖于本申请保护范围内。In the embodiments of the present disclosure, the referenceable materials include consulting articles, pictures, or expressions related to the text template or user input content, and the correlation between the referenceable materials and the text template can be achieved through statistical methods. For example, count the number of times the keywords and reference materials in the text template appear in the same article. If the number of times is greater than a preset threshold, the reference materials will be displayed. It should be noted that the display of the reference materials The implementation of is not limited to the above examples. It is also possible to display related reference materials by establishing the correspondence between text template keywords and reference materials. Those skilled in the art may also make other changes under the enlightenment of the technical essence of this application. , But as long as the functions and effects achieved are the same or similar to those of this application, they shall be covered by the scope of protection of this application.
通过可参考素材的提供,方便用户了解文本主题事件的来龙去脉,图片和表情等素材的使用,丰富了文章的可阅览性,提高了生成文本的质量。Through the provision of reference materials, it is convenient for users to understand the ins and outs of text theme events, the use of pictures and expressions and other materials, which enriches the readability of articles and improves the quality of generated text.
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
步骤S21,接收用户关于所述可参考素材的编辑指令,将所述可参考素材复制或替换到所述文本模板的指定位置。Step S21: Receive a user's editing instruction on the reference material, and copy or replace the reference material to a designated position of the text template.
本公开实施例中,可参考素材可以通过复制或替换的方式添加到文本模板的相位置处,便于用户对文本模板的修改,在一种可能的方式中,还可以通过拖运的方式,将所述可参考素材复制到所述文本模板的指定位置,需要说明的是,所述可参考素材的添加的实现方式不限于上述举例,所属领域技术人员在本申请技术精髓的启示下,还可能做出其它变更,但只要其实现的功能和效果与本申请相同或相似,均应涵盖于本申请保护范围内。In the embodiments of the present disclosure, the reference material can be added to the relative position of the text template by copying or replacing, which is convenient for users to modify the text template. In a possible way, it can also be dragged and transported. The reference material is copied to the specified position of the text template. It should be noted that the implementation of adding the reference material is not limited to the above examples. Those skilled in the art may also be enlightened by the technical essence of this application. Other changes are made, but as long as the functions and effects achieved are the same or similar to those of this application, they shall be covered by the scope of protection of this application.
在一种可能的实现方式中,所述步骤S12,响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段,包括:In a possible implementation, the step S12, in response to the trigger instruction, displaying the content of the text template, and marking the field with replaceable material in the content, includes:
步骤S121,响应于所述触发指令,分段展示文本模板的内容,并标注所述内容中具有可替换素材的字段。Step S121: In response to the triggering instruction, the content of the text template is displayed in segments, and the fields with replaceable materials in the content are marked.
步骤S122,接收用户段落调整的指令,将所述文本模板中的指定段落调整至指定位置。Step S122: Receive a paragraph adjustment instruction from the user, and adjust the designated paragraph in the text template to a designated position.
本公开实施例中,所述分段展示包括可以以文本模板的一句话,作为一个操作单元,进行展示,还可以以文本模板的一段话,作为一个操作单元,进行展示,需要说明的是,当操作单元包含的字数越少时,对文本模板编辑的灵活度越大,当然,还可以以其他方式对所述文本模板进行分段,在这里不作限制。In the embodiment of the present disclosure, the segmented display includes a sentence that can be displayed in a text template as an operation unit, and a paragraph in the text template can also be displayed as an operation unit. It should be noted that, When the number of words contained in the operating unit is smaller, the flexibility of editing the text template is greater. Of course, the text template can also be segmented in other ways, which is not limited here.
本公开实施例中,可以在每一段的文本内容旁边设置操作控件,通过选中控件,实现对所述段落的文本内容位置的调整,比如可以通过拖拽的方式,实现两个段落的位置置换。In the embodiment of the present disclosure, an operation control can be set next to the text content of each paragraph, and the position of the text content of the paragraph can be adjusted by selecting the control, for example, the position replacement of two paragraphs can be realized by dragging.
本公开对文本段落进行分段展示,具有较高的灵活性,通过设置操作控件实现文本模板中任意段落的位置调整,便于用户自由调整。The present disclosure displays text paragraphs in sections and has high flexibility. The position adjustment of any paragraph in the text template is realized by setting operation controls, which is convenient for users to adjust freely.
在一种可能的实现方式中,在所述步骤S11,在所述接收文本编辑的触发指令之前,还包括:In a possible implementation manner, in the step S11, before the receiving a text editing trigger instruction, the method further includes:
步骤S22,从多个平台获取文本数据;Step S22, obtaining text data from multiple platforms;
步骤S23,对所述文本数据进行分词处理,确定所述可替换素材。Step S23: Perform word segmentation processing on the text data to determine the replaceable material.
本公开实施例中,可以预先通过网络爬虫的技术手段抓取各个平台的网页内容以及文本数据,并对抓取后的文本数据进行分词处理,建立词语与词语,词语与短语、词语与句子之间的关联关系,以确定文本模板中可替换素材,进一步的,可以通过统计所述词语与其他词语、其他短语或其他句子出现在同一篇文章的频率次数,进行相关性的排序,优先展示相关性较高的可替换素材。In the embodiments of the present disclosure, the webpage content and text data of each platform can be captured in advance through the technical means of web crawlers, and the captured text data can be word segmented to establish the relationship between words and words, words and phrases, words and sentences. In order to determine the replaceable material in the text template, further, you can count the frequency of occurrence of the word and other words, other phrases or other sentences in the same article, sort the relevance, and display the relevant first Replaceable materials with high performance.
图3(a)~图3(c)是根据一示例性实施例示出的一种文本生成方法的界面示意图。参考图3(a)所示,所述显示界面中包含多个输入框中的输入内容,比如文章标题输入框309,文章头部输入框310,文章中部输入框311,问号在那个尾部输入框312,这样,在标题包含标题输入框中的输入内容的文本模板将会被检索到,类似的,在正文首段包含正文首段输入框中的输入内容的文本模板将会被检索到。参考图3(b)所示,打开一篇文本模板,点击文本编辑触发空间313,进入编辑界面,参考图3(c)所示,展示了文本模板的内容,标注所述内容中具有可替换素材的字段301,所述界面上设置有一键替换控件304、语法分析控件307,可参考素材如资讯类素材302,图片素材303,资讯类素材列表306,分段展示文本模板的内容,图3(c)中以一句话作为一个段落单元进行展示,在每一段的文本内容旁边设置操作控件308,通过选中控件,实现对所述段落的文本内容位置的调整,比如可以通过拖拽的方式,实现两个段落的位置置换。Figs. 3(a) to 3(c) are schematic diagrams showing interfaces of a text generation method according to an exemplary embodiment. Referring to Figure 3(a), the display interface contains input content in multiple input boxes, such as the article title input box 309, the article head input box 310, the article middle input box 311, and the question mark is in the end input box 312. In this way, the text template that contains the input content in the title input box in the title will be retrieved. Similarly, the text template that contains the input content in the first paragraph of the body text input box will be retrieved. Refer to Figure 3(b), open a text template, click on the text editing trigger space 313 to enter the editing interface, refer to Figure 3(c), which shows the content of the text template, and mark that the content can be replaced The material field 301. The interface is provided with a key replacement control 304 and a syntax analysis control 307. You can refer to materials such as information material 302, picture material 303, information material list 306, and display the contents of the text template in sections, as shown in Figure 3. In (c), a sentence is displayed as a paragraph unit. An operation control 308 is set next to the text content of each paragraph. By selecting the control, the position of the text content of the paragraph can be adjusted, for example, by dragging. Realize the position replacement of two paragraphs.
图4是根据一示例性实施例示出的一种文本生成装置框图。参照图4,该装置包括:Fig. 4 is a block diagram showing a text generating device according to an exemplary embodiment. Referring to Figure 4, the device includes:
第一接收模块11,用于接收文本编辑的触发指令;The first receiving module 11 is used to receive a text editing trigger instruction;
第一展示模块12,用于响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段;The first display module 12 is configured to display the content of the text template in response to the trigger instruction, and mark the fields with replaceable materials in the content;
生成模块13,用于根据用户选择的所述文本模板中目标字段的目标可替换素材,将所述目标字段替换为所述目标可替换素材。The generating module 13 is configured to replace the target field with the target replaceable material according to the target replaceable material of the target field in the text template selected by the user.
在一种可能的实现方式中,所述字段上设置有控件,通过对所述控件进行预设操作,可展示所述字段的所述可替换素材。In a possible implementation manner, a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第二接收模块,用于接收用户的输入内容;The second receiving module is used to receive user input;
第二展示模块,用于根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板;The second display module is configured to display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
确定模块,用于根据用户的选择指令,确定文本模板。The determination module is used to determine the text template according to the user's selection instruction.
在一种可能的实现方式中,所述第二展示模块包括:In a possible implementation manner, the second display module includes:
排序子模块,用于根据输入内容中的关键词与文本模板预设的对应关系,基于预设原创度规则,按照所述文本模板原创度由高到低的顺序,展示与所述输入内容相关联的至少一个文本模板。The sorting sub-module is used to display the content related to the input content according to the preset corresponding relationship between the keywords in the input content and the text template, and based on the preset originality rule, according to the order of the originality of the text template from high to low At least one text template of the link.
在一种可能的实现方式中,所述第二接收模块包括:In a possible implementation manner, the second receiving module includes:
接收子模块,用于接收多个输入框中的输入内容,所述多个输入框分别对应于文章的不同组成部分。The receiving sub-module is used to receive input content in multiple input boxes, and the multiple input boxes respectively correspond to different components of the article.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第三接收模块,用于接收一键替换控件的触发指令;The third receiving module is used to receive a trigger instruction of one-key replacement of the control;
替换模块,用于根据用户历史可替换素材的字段的替换数据,将所述文本模板的所述字段替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段。The replacement module is configured to replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material, and the history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第四接收模块,用于接收语法分析控件的触发指令;The fourth receiving module is used to receive the trigger instruction of the syntax analysis control;
第三展示模块,用于展示所述可替换素材的字段之间的语法关系。The third display module is used to display the grammatical relationship between the fields of the replaceable material.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
判断模块,用于判断所述目标可替换素材是否符合预设的语法规则The judgment module is used to judge whether the target replaceable material meets the preset grammatical rules
标注模块,用于若所述目标可替换素材不符合所述语法规则,则标注出不符合规则的位置。The marking module is used for marking the position that does not conform to the rule if the target replaceable material does not conform to the grammatical rule.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第四展示模块,用于展示可参考素材,所述可参考素材与文本模板的相关性大于预设阈值。The fourth display module is used to display reference materials, and the correlation between the reference materials and the text template is greater than a preset threshold.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第五接收模块,用于接收用户关于所述可参考素材的编辑指令,将所述可参考素材复制或替换到所述文本模板的指定位置。The fifth receiving module is configured to receive the user's editing instruction on the reference material, and copy or replace the reference material to the designated position of the text template.
在一种可能的实现方式中,所述第一展示模块包括:In a possible implementation manner, the first display module includes:
展示子模块,用于响应于所述触发指令,分段展示文本模板的内容,并标注所述内容中具有可替换素材的字段;The display sub-module is used to display the content of the text template in segments in response to the trigger instruction, and mark the fields with replaceable materials in the content;
调整子模块,用于接收用户段落调整的指令,将所述文本模板中的指定段落调整至指定位置。The adjustment sub-module is used to receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
获取模块,用于从多个平台获取文本数据;Acquisition module, used to acquire text data from multiple platforms;
分词模块,对所述文本数据进行分词处理,确定所述可替换素材。The word segmentation module performs word segmentation processing on the text data to determine the replaceable material.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the foregoing embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and detailed description will not be given here.
图5是根据一示例性实施例示出的一种文本生成的装置800的框图。例如,装置800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 5 is a block diagram showing a device 800 for generating text according to an exemplary embodiment. For example, the device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
参照图5,装置800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。5, the device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, And the communication component 816.
处理组件802通常控制装置800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operations of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
存储器804被配置为存储各种类型的数据以支持在装置800的操作。这些数据的示例包括用于在装置800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations in the device 800. Examples of these data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
电源组件806为装置800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为装置800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
多媒体组件808包括在所述装置800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当装置800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当装置800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点 击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module. The peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为装置800提供各个方面的状态评估。例如,传感器组件814可以检测到装置800的打开/关闭状态,组件的相对定位,例如所述组件为装置800的显示器和小键盘,传感器组件814还可以检测装置800或装置800一个组件的位置改变,用户与装置800接触的存在或不存在,装置800方位或加速/减速和装置800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。The sensor component 814 includes one or more sensors for providing the device 800 with various aspects of status assessment. For example, the sensor component 814 can detect the open/close state of the device 800 and the relative positioning of components. For example, the component is the display and the keypad of the device 800. The sensor component 814 can also detect the position change of the device 800 or a component of the device 800. , The presence or absence of contact between the user and the device 800, the orientation or acceleration/deceleration of the device 800, and the temperature change of the device 800. The sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact. The sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件816被配置为便于装置800和其他设备之间有线或无线方式的通信。装置800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,装置800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing equipment (DSPD), programmable logic devices (PLD), field programmable A gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由装置800的处理器820执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as the memory 804 including instructions, which can be executed by the processor 820 of the device 800 to complete the foregoing method. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
图6是根据一示例性实施例示出的一种用于文本生成装置1900的框图。例如,装置1900可以被提供为一服务器。参照图6,装置1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。Fig. 6 is a block diagram showing a device 1900 for generating text according to an exemplary embodiment. For example, the device 1900 may be provided as a server. 6, the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above-described methods.
装置1900还可以包括一个电源组件1926被配置为执行装置1900的电源管理,一个有线或无线网络接口1950被配置为将装置1900连接到网络,和一个输入输出(I/O)接口1958。装置1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to the network, and an input output (I/O) interface 1958. The device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器1932,上述指令可由装置1900的处理组件1922执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as the memory 1932 including instructions, which may be executed by the processing component 1922 of the device 1900 to complete the foregoing method. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开 的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Those skilled in the art will easily think of other embodiments of the present disclosure after considering the description and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure . The description and the embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims (26)

  1. 一种文本生成方法,其特征在于,包括:A text generation method, characterized in that it comprises:
    接收文本编辑的触发指令;Receive the trigger command for text editing;
    响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段;In response to the triggering instruction, display the content of the text template, and mark the fields with replaceable materials in the content;
    根据用户选择的所述文本模板中目标字段的目标可替换素材,将所述目标字段替换为所述目标可替换素材。According to the target replaceable material of the target field in the text template selected by the user, the target field is replaced with the target replaceable material.
  2. 根据权利要求1所述的方法,其特征在于,所述字段上设置有控件,通过对所述控件进行预设操作,可展示所述字段的所述可替换素材。The method according to claim 1, wherein a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
  3. 根据权利要求1所述的方法,其特征在于,在所述接收文本编辑的触发指令之前,还包括:The method according to claim 1, characterized in that, before said receiving a text editing trigger instruction, the method further comprises:
    接收用户的输入内容;Receive user input;
    根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板;Displaying at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
    根据用户的选择指令,确定文本模板。According to the user's selection instruction, the text template is determined.
  4. 根据权利要求3所述的方法,其特征在于,所述根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板,包括:The method according to claim 3, wherein the displaying at least one text template associated with the input content according to a preset correspondence between keywords in the input content and a text template comprises:
    根据输入内容中的关键词与文本模板预设的对应关系,基于预设原创度规则,按照所述文本模板原创度由高到低的顺序,展示与所述输入内容相关联的至少一个文本模板。According to the preset correspondence between the keywords in the input content and the text template, and based on the preset originality rules, display at least one text template associated with the input content in descending order of the originality of the text template .
  5. 根据权利要求3所述的方法,其特征在于,所述接收用户的输入内容,包括:The method according to claim 3, wherein said receiving user input content comprises:
    接收多个输入框中的输入内容,所述多个输入框分别对应于文章的不同组成部分。Receive input content in multiple input boxes, the multiple input boxes respectively corresponding to different components of the article.
  6. 根据权利要求1所述的方法,其特征在于,在所述响应于所述触发指令,显示文本模板的内容,并标注所述内容中具有可替换素材的字段之后,还包括:The method according to claim 1, after displaying the content of the text template in response to the trigger instruction, and marking a field with replaceable material in the content, the method further comprises:
    接收一键替换控件的触发指令;Receive a trigger command to replace the control with one click;
    根据用户历史可替换素材的字段的替换数据,将所述文本模板的所述字段替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段。According to the replacement data of the field of the user's historical replaceable material, the field of the text template is replaced with a history replacement field, and the history replacement field includes fields whose replacement times in the user history are greater than a preset threshold.
  7. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    接收语法分析控件的触发指令;Receive the trigger instruction of the syntax analysis control;
    展示所述可替换素材的字段之间的语法关系。Show the grammatical relationship between the fields of the replaceable material.
  8. 根据权利要求7所述的方法,其特征在于,还包括:The method according to claim 7, further comprising:
    判断所述目标可替换素材是否符合预设的语法规则;Judging whether the target replaceable material complies with preset grammatical rules;
    若所述目标可替换素材不符合所述语法规则,则标注出不符合规则的位置。If the target replaceable material does not conform to the grammatical rule, the position that does not conform to the rule is marked.
  9. 根据权利要求1所述的方法,其特征在于,在所述接收文本编辑的触发指令之后还包括:The method according to claim 1, wherein after said receiving a text editing trigger instruction, the method further comprises:
    展示可参考素材,所述可参考素材与文本模板的相关性大于预设阈值。Displaying reference material, the correlation between the reference material and the text template is greater than a preset threshold.
  10. 根据权利要求9所述的方法,其特征在于,还包括:The method according to claim 9, further comprising:
    接收用户关于所述可参考素材的编辑指令,将所述可参考素材复制或替换到所述文本模板的指定位置。Receive a user's editing instruction on the referenceable material, and copy or replace the referenceable material to a designated position of the text template.
  11. 根据权利要求1所述的方法,其特征在于,响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段,包括:The method according to claim 1, wherein, in response to the trigger instruction, displaying the content of the text template, and marking a field with replaceable material in the content, comprises:
    响应于所述触发指令,分段展示文本模板的内容,并标注所述内容中具有可替换素材的字段;In response to the trigger instruction, display the content of the text template in segments, and mark the fields with replaceable materials in the content;
    接收用户段落调整的指令,将所述文本模板中的指定段落调整至指定位置。Receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
  12. 根据权利要求1所述的方法,其特征在于,在所述接收文本编辑的触发指令之前还包括:The method according to claim 1, characterized in that, before said receiving a text editing trigger instruction, the method further comprises:
    从多个平台获取文本数据;Obtain text data from multiple platforms;
    对所述文本数据进行分词处理,确定所述可替换素材。Perform word segmentation processing on the text data to determine the replaceable material.
  13. 一种文本生成装置,其特征在于,包括:A text generating device, characterized in that it comprises:
    第一接收模块,用于接收文本编辑的触发指令;The first receiving module is used to receive a trigger instruction for text editing;
    第一展示模块,用于响应于所述触发指令,展示文本模板的内容,并标注所述内容中具有可替换素材的字段;The first display module is configured to display the content of the text template in response to the trigger instruction, and mark the fields with replaceable materials in the content;
    生成模块,用于根据用户选择的所述文本模板中目标字段的目标可替换素材,将所述目标字段替换为所述目标可替换素材。The generating module is configured to replace the target field with the target replaceable material according to the target replaceable material of the target field in the text template selected by the user.
  14. 根据权利要求13所述的装置,其特征在于,所述字段上设置有控件,通过对所述控件进行预设操作,可展示所述字段的所述可替换素材。The apparatus according to claim 13, wherein a control is provided on the field, and the replaceable material of the field can be displayed by performing a preset operation on the control.
  15. 根据权利要求13所述的装置,其特征在于,还包括:The device according to claim 13, further comprising:
    第二接收模块,用于接收用户的输入内容;The second receiving module is used to receive user input;
    第二展示模块,用于根据输入内容中的关键词与文本模板预设的对应关系,展示与所述输入内容相关联的至少一个文本模板;The second display module is configured to display at least one text template associated with the input content according to the preset correspondence between the keywords in the input content and the text template;
    确定模块,用于根据用户的选择指令,确定文本模板。The determination module is used to determine the text template according to the user's selection instruction.
  16. 根据权利要求15所述的装置,其特征在于,所述第二展示模块包括:The device according to claim 15, wherein the second display module comprises:
    排序子模块,用于根据输入内容中的关键词与文本模板预设的对应关系,基于预设原创度规则,按照所述文本模板原创度由高到低的顺序,展示与所述输入内容相关联的至少一个文本模板。The sorting sub-module is used to display the content related to the input content according to the preset corresponding relationship between the keywords in the input content and the text template, and based on the preset originality rule, according to the order of the originality of the text template from high to low At least one text template of the link.
  17. 根据权利要求15所述的装置,其特征在于,所述第二接收模块包括:The device according to claim 15, wherein the second receiving module comprises:
    接收子模块,用于接收多个输入框中的输入内容,所述多个输入框分别对应于文章的不同组成部分。The receiving sub-module is used to receive input content in multiple input boxes, and the multiple input boxes respectively correspond to different components of the article.
  18. 根据权利要求13所述的装置,其特征在于,还包括:The device according to claim 13, further comprising:
    第三接收模块,用于接收一键替换控件的触发指令;The third receiving module is used to receive a trigger instruction of one-key replacement of the control;
    替换模块,用于根据用户历史可替换素材的字段的替换数据,将所述文本模板的所述字段替换为历史替换字段,所述历史替换字段包括用户历史上替换次数大于预设阈值的字段。The replacement module is configured to replace the field of the text template with a history replacement field according to the replacement data of the field of the user's historical replaceable material, and the history replacement field includes a field whose replacement times in the user history are greater than a preset threshold.
  19. 根据权利要求13所述的装置,其特征在于,还包括:The device according to claim 13, further comprising:
    第四接收模块,用于接收语法分析控件的触发指令;The fourth receiving module is used to receive the trigger instruction of the syntax analysis control;
    第三展示模块,用于展示所述可替换素材的字段之间的语法关系。The third display module is used to display the grammatical relationship between the fields of the replaceable material.
  20. 根据权利要求19所述的装置,其特征在于,还包括:The device according to claim 19, further comprising:
    判断模块,用于判断所述目标可替换素材是否符合预设的语法规则The judgment module is used to judge whether the target replaceable material meets the preset grammatical rules
    标注模块,用于若所述目标可替换素材不符合所述语法规则,则标注出不符合规则的位置。The marking module is used for marking the position that does not conform to the rule if the target replaceable material does not conform to the grammatical rule.
  21. 根据权利要求13所述的装置,其特征在于,还包括:The device according to claim 13, further comprising:
    第四展示模块,用于展示可参考素材,所述可参考素材与文本模板的相关性大于预设阈值。The fourth display module is used to display reference materials, and the correlation between the reference materials and the text template is greater than a preset threshold.
  22. 根据权利要求21所述的装置,其特征在于,还包括:The device according to claim 21, further comprising:
    第五接收模块,用于接收用户关于所述可参考素材的编辑指令,将所述可参考素材复制或替换到所述文本模板的指定位置。The fifth receiving module is configured to receive the user's editing instruction on the reference material, and copy or replace the reference material to the designated position of the text template.
  23. 根据权利要求13所述的装置,其特征在于,所述第一展示模块包括:The device according to claim 13, wherein the first display module comprises:
    展示子模块,用于响应于所述触发指令,分段展示文本模板的内容,并标注所述内容中具有可替换素材的字段;The display sub-module is used to display the content of the text template in segments in response to the trigger instruction, and mark the fields with replaceable materials in the content;
    调整子模块,用于接收用户段落调整的指令,将所述文本模板中的指定段落调整至指定位置。The adjustment sub-module is used to receive a paragraph adjustment instruction from the user, and adjust the specified paragraph in the text template to a specified position.
  24. 根据权利要求13所述装置,其特征在于,还包括:The device according to claim 13, further comprising:
    获取模块,用于从多个平台获取文本数据;Acquisition module, used to acquire text data from multiple platforms;
    分词模块,对所述文本数据进行分词处理,确定所述可替换素材。The word segmentation module performs word segmentation processing on the text data to determine the replaceable material.
  25. 一种文本生成装置,其特征在于,包括:A text generating device, characterized in that it comprises:
    处理器;processor;
    用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
    其中,所述处理器被配置为执行权利要求1至12中任一项所述的方法。Wherein, the processor is configured to execute the method of any one of claims 1-12.
  26. 一种非临时性计算机可读存储介质,当所述存储介质中的指令由处理器执行时,使得处理器能够执行根据权利要求1至12中任一项的方法。A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor, so that the processor can execute the method according to any one of claims 1 to 12.
PCT/CN2019/115286 2019-07-30 2019-11-04 Text generation method and apparatus WO2021017238A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910694671.5A CN110502734A (en) 2019-07-30 2019-07-30 A kind of document creation method and device
CN201910694671.5 2019-07-30

Publications (1)

Publication Number Publication Date
WO2021017238A1 true WO2021017238A1 (en) 2021-02-04

Family

ID=68587790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/115286 WO2021017238A1 (en) 2019-07-30 2019-11-04 Text generation method and apparatus

Country Status (2)

Country Link
CN (1) CN110502734A (en)
WO (1) WO2021017238A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448560A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Data configuration method, device and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073649B (en) * 2020-09-04 2022-12-13 北京字节跳动网络技术有限公司 Multimedia data processing method, multimedia data generating method and related equipment
CN113706664B (en) * 2021-08-31 2023-11-10 重庆杰夫与友文化创意有限公司 Marketing content generation method, system and storage medium based on intelligent scene recognition
CN116543389B (en) * 2023-03-13 2023-09-19 中国人民解放军海军工程大学 Character recognition method, device, equipment and medium based on relational network
CN116257579B (en) * 2023-05-15 2023-08-11 北京欧应科技有限公司 Method, computing device and storage medium for text generation of target object

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1837779A1 (en) * 2006-03-24 2007-09-26 Sap Ag Multi-modal content presentation
CN106933862A (en) * 2015-12-30 2017-07-07 北京神州泰岳软件股份有限公司 A kind of method and apparatus for generating mail report
CN108519966A (en) * 2018-04-11 2018-09-11 掌阅科技股份有限公司 The replacement method and computing device of e-book particular text element
CN109657223A (en) * 2018-12-18 2019-04-19 安徽省泰岳祥升软件有限公司 Automatic writing method and device for official document

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8504984B1 (en) * 2009-05-29 2013-08-06 Google Inc. Modifying grammars to correct programming language statements
CN106445894B (en) * 2015-08-13 2019-07-30 中国科学院计算技术研究所 New media intelligent online edit methods, device and Web information issuance platform
CN109213845B (en) * 2018-09-06 2021-06-08 杭州凡闻科技有限公司 Original news evaluation method and system based on article characteristics
CN109902305A (en) * 2019-03-04 2019-06-18 上海宝尊电子商务有限公司 Template generation, search and text generation apparatus and method for based on name Entity recognition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1837779A1 (en) * 2006-03-24 2007-09-26 Sap Ag Multi-modal content presentation
CN106933862A (en) * 2015-12-30 2017-07-07 北京神州泰岳软件股份有限公司 A kind of method and apparatus for generating mail report
CN108519966A (en) * 2018-04-11 2018-09-11 掌阅科技股份有限公司 The replacement method and computing device of e-book particular text element
CN109657223A (en) * 2018-12-18 2019-04-19 安徽省泰岳祥升软件有限公司 Automatic writing method and device for official document

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448560A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Data configuration method, device and storage medium
CN113448560B (en) * 2021-08-30 2022-03-01 阿里云计算有限公司 Data configuration method, device and storage medium

Also Published As

Publication number Publication date
CN110502734A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
WO2021017238A1 (en) Text generation method and apparatus
CN107527619B (en) Method and device for positioning voice control service
KR101855147B1 (en) An analysis method for user preference and device therefor
CN107621886B (en) Input recommendation method and device and electronic equipment
CN110019675B (en) Keyword extraction method and device
CN110989847B (en) Information recommendation method, device, terminal equipment and storage medium
CN111382339B (en) Search processing method and device for search processing
CN113157753B (en) Display method and device and electronic equipment
WO2023284799A1 (en) Search method and apparatus, and electronic device
CN107515870B (en) Searching method and device and searching device
CN110309324B (en) Searching method and related device
CN110196833A (en) Searching method, device, terminal and the storage medium of application program
CN108197105A (en) Natural language processing method, apparatus, storage medium and electronic equipment
CN111813932B (en) Text data processing method, text data classifying device and readable storage medium
CN107784037B (en) Information processing method and device, and device for information processing
CN110110046B (en) Method and device for recommending entities with same name
CN111708444A (en) Input method, input device and input device
CN112328809A (en) Entity classification method, device and computer readable storage medium
US20190258666A1 (en) Resource accessibility services
CN110147426B (en) Method for determining classification label of query text and related device
CN115640790A (en) Information processing method and device and electronic equipment
CN113157966B (en) Display method and device and electronic equipment
CN110929122B (en) Data processing method and device for data processing
CN109308151B (en) Information processing method, device, equipment and storage medium
CN110633399A (en) Data processing method and device and data processing device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19939181

Country of ref document: EP

Kind code of ref document: A1