WO2023036101A1 - 确定文本情节类型的方法、装置、可读介质及电子设备 - Google Patents

确定文本情节类型的方法、装置、可读介质及电子设备 Download PDF

Info

Publication number
WO2023036101A1
WO2023036101A1 PCT/CN2022/117160 CN2022117160W WO2023036101A1 WO 2023036101 A1 WO2023036101 A1 WO 2023036101A1 CN 2022117160 W CN2022117160 W CN 2022117160W WO 2023036101 A1 WO2023036101 A1 WO 2023036101A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
target
plot
sentence
model
Prior art date
Application number
PCT/CN2022/117160
Other languages
English (en)
French (fr)
Inventor
伍林
殷翔
马泽君
Original Assignee
北京有竹居网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京有竹居网络技术有限公司 filed Critical 北京有竹居网络技术有限公司
Publication of WO2023036101A1 publication Critical patent/WO2023036101A1/zh

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/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks

Definitions

  • the present disclosure relates to the field of natural language processing, and in particular, relates to a method, device, readable medium and electronic equipment for determining a text plot type.
  • the present disclosure provides a method for determining a text plot type, the method comprising:
  • At least one plot text corresponding to the target text is obtained, and the plot text is used to represent text of the same plot type;
  • a target plot type corresponding to the plot text is acquired through a pre-trained plot type acquisition model.
  • the present disclosure provides a device for determining a text plot type, the device comprising:
  • a statement acquisition module configured to acquire a plurality of target statements corresponding to the target text
  • a text acquisition module configured to obtain at least one plot text corresponding to the target text through a pre-trained text segmentation model according to multiple target sentences, and the plot text is used to represent text of the same plot type;
  • the genre acquisition module is configured to acquire, for each plot text, the target plot type corresponding to the plot text through a pre-trained plot type acquisition model according to the plot text.
  • the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.
  • an electronic device including:
  • a processing device configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
  • the present disclosure can obtain at least one target plot type corresponding to the target text through the text division model and the plot type acquisition model, so that the text plot type can be determined without manual operation, thereby improving the efficiency of background music production.
  • Fig. 1 is a flowchart showing a method for determining a text plot type according to an exemplary embodiment of the present disclosure
  • Fig. 2 is a flow chart showing another method for determining a text plot type according to an exemplary embodiment of the present disclosure
  • Fig. 3 is a schematic diagram of a text segmentation model according to an exemplary embodiment of the present disclosure
  • Fig. 4 is a block diagram of an apparatus for determining a text plot type according to an exemplary embodiment of the present disclosure
  • Fig. 5 is a block diagram of a second device for determining a text plot type according to an exemplary embodiment of the present disclosure
  • Fig. 6 is a block diagram of a third device for determining a text plot type according to an exemplary embodiment of the present disclosure
  • Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • Fig. 1 is a flow chart of a method for determining a text plot type according to an exemplary embodiment of the present disclosure. As shown in Fig. 1 , the method may include:
  • the target text may include multiple plot texts.
  • the first sentence to the 20th sentence in the target text is the first plot text
  • the 21st sentence to the 55th sentence is the second plot text
  • the 56th sentence Sentence to 100th sentence is the third plot text.
  • a plurality of target sentences corresponding to the target text can be acquired through the sentence segmentation method in the prior art, and details will not be described here.
  • the plot text can be used to characterize the text of the same plot type
  • the target text can only include one plot text, that is, the target text as a whole is one plot text
  • the target text can also include multiple plot texts, the multiple plot texts
  • the plot types of adjacent plot texts in the text are different, and the plot types of non-adjacent plot texts can be the same.
  • the text segmentation model can be obtained by training a model training method in the prior art, and will not be repeated here.
  • multiple target sentences can be input into the text segmentation model to obtain the identification information of each target sentence, and according to the identification information of multiple target sentences, determine At least one plot text corresponding to the target text.
  • the identification information is used to represent the association relationship between the target sentence and adjacent sentences, and the adjacent sentences may include sentences adjacent to the target sentence.
  • the plot text can be input into the plot type acquisition module to obtain the target plot type corresponding to the plot text.
  • the plot type acquisition model can be obtained by training a model training method in the prior art, which will not be repeated here.
  • At least one target plot type corresponding to the target text can be obtained through the text division model and the plot type acquisition model, so that the text plot type can be determined without manual operation, thereby improving the efficiency of making background music.
  • Fig. 2 is a flow chart showing another method for determining a text plot type according to an exemplary embodiment of the present disclosure. As shown in Fig. 2 , the method may include:
  • the target text may include multiple plot texts.
  • the target text includes 28 target sentences, a1 is the first target sentence in the target text, and a28 is the last target sentence in the target text.
  • the text segmentation model may include a sentence feature acquisition sub-model and a text segmentation sub-model, and the sentence feature acquisition sub-model and the text segmentation sub-model can be obtained by training a model training method in the prior art, and will not be repeated here.
  • the sentence features can include forward sentence features and reverse sentence features, the forward sentence features and the reverse sentence features can be obtained through target sentences of different word orders, for example, the forward sentence features can be according to the target
  • the sentence features of each target sentence obtained in the order of the target sentences in the text from front to back, the reverse sentence feature may be the sentence features of each target sentence obtained in the order of the target sentences in the target text from back to front.
  • the character vector corresponding to each character in the target sentence can be obtained through the method of the prior art, and then each target A plurality of character vectors corresponding to the sentence are input into the sentence feature acquisition sub-model to obtain the sentence feature corresponding to the target sentence.
  • the sentence feature acquisition sub-model may include a forward sentence feature acquisition sub-model and a reverse sentence feature acquisition sub-model, the forward sentence feature is a feature corresponding to the target sentence in the first word order, the The reverse sentence feature is the feature corresponding to the target sentence of the second word order. The first word order is opposite to the second word order.
  • the forward sentence feature corresponding to the target sentence can be obtained through the forward sentence feature acquisition sub-model.
  • the sentence feature acquisition sub-model can obtain the reverse sentence feature corresponding to the target sentence.
  • the sentence feature acquisition sub-model can be based on a two-way LSTM (Long Short-Term Memory, long-short-term memory) neural network model.
  • LSTM Long Short-Term Memory, long-short-term memory
  • FIG. 3 is a schematic diagram of a text segmentation model according to an exemplary embodiment of the present disclosure.
  • the text division sub-model includes LSTM neural network model, fully connected layer and CRF (Conditional Random Fields, conditional random field) layer.
  • CRF Consumer Random Fields, conditional random field
  • the sentence features corresponding to multiple target sentences can be input into the text segmentation sub-model to obtain the identification information of the target sentence corresponding to each sentence feature, the identification information It is used to characterize the association relationship between the target sentence and adjacent sentences, and determine at least one plot text corresponding to the target text according to the identification information of multiple target sentences.
  • the identification information may include an initial identification, an intermediate identification, and an end identification.
  • the target initial sentence corresponding to the target initial identification The target termination statement corresponding to the target termination identifier and the target intermediate statement corresponding to the target intermediate identifier are used as a plot text; wherein, the target start identifier is any one of multiple start identifiers, for example, the start identifier Including multiple, the target start identifier can be determined from multiple start identifiers first, for example, each start identifier can be used as the target start identifier in turn according to the specified order; the target end identifier is the target start identifier After the first end identifier, the target intermediate identifier includes an intermediate identifier located between the target start identifier and the target end identifier.
  • the present disclosure may use a BME sequence tagging method to tag the tag information of the target sentence, the start tag may be B, the intermediate tag may be M, and the end tag may be E.
  • the target sentence a1 is the first target sentence of the target text
  • the identification information of a1 can be B, if the obtained identification information of a2-a10 is M, and the identification information of a11 is E, Then a1-a11 can be determined as the first plot text in the target text, if the obtained identification information of a12 is B, the identification information of a13-a27 is M, and the identification information of a28 is E, then a12-a28 can be determined It is the second plot text in the target text.
  • the forward sentence features and reverse sentence features corresponding to the target sentence can be Splicing to obtain the splicing statement features corresponding to the target sentence.
  • the forward sentence features and reverse sentence features corresponding to the target sentence can be spliced by the concat method. After that, the text can be passed according to multiple splicing sentence features. Divide the sub-models to obtain at least one plot text corresponding to the target text.
  • step S201 Exemplarily, continuing to take the target text in step S201 as an example, after obtaining the forward sentence features and reverse sentence features corresponding to each target sentence, as shown in Figure 3, the forward sentence features and the reverse The sentence features are spliced, and the spliced sentence features after splicing are input into the LSTM neural network model in the text division sub-model (the process of splicing is not shown in the figure), and then, after being processed by the fully connected layer and the CRF layer, the output The identification information of the target sentence corresponding to each sentence feature.
  • the plot type acquisition model can be composed of Transformer, fully connected layer and softmax.
  • the preset plot type with the largest probability value among the multiple preset plot types can be used as the target plot type corresponding to the plot text .
  • the preset plot type includes monologue, happy enemy, villain provocation
  • the probability value of monologue is 1%
  • the probability value of happy enemy is 0.5%
  • the probability value of villain provocation is 98.5%
  • the plot text can be determined
  • the corresponding target plot type is villain provocation.
  • the multimedia information may be background music, background pictures, etc., which are not limited in the present disclosure.
  • the multimedia information corresponding to the target plot type can be determined through the preset multimedia information association relationship, and the multimedia information association relationship can include different target plot types and Correspondence between multimedia information.
  • the multimedia information can be displayed synchronously. Taking the multimedia information as the background music as an example, when the plot text is displayed, the corresponding background music can be displayed, thereby improving the text reading experience.
  • the sentence features of each target sentence in the target text can be obtained through the sentence feature acquisition sub-model, and multiple sentence features can be used as the input of the text division sub-model to obtain each sentence
  • the identification information of the target sentence corresponding to the feature determine at least one plot text corresponding to the target text according to the identification information, and finally, determine the target plot type corresponding to the plot text through the plot type acquisition module, so that without manual operation, you can Determine the text plot type, thereby improving the efficiency of making background music; in addition, because the sentence feature is obtained according to the character vector corresponding to each character in the target sentence, the character of the target text is also reflected in the process of determining the plot text
  • the level and sentence level information makes the accuracy rate of the determined plot text higher, thereby improving the accuracy rate of the multimedia information of the determined target text.
  • Fig. 4 is a block diagram of an apparatus for determining a text plot type according to an exemplary embodiment of the present disclosure. As shown in Fig. 4 , the apparatus may include:
  • Sentence acquisition module 401 configured to acquire a plurality of target sentences corresponding to the target text
  • the text acquisition module 402 is used to obtain at least one plot text corresponding to the target text through a pre-trained text segmentation model according to the plurality of target sentences, and the plot text is used to represent the text of the same plot type;
  • the genre acquisition module 403 is configured to acquire, for each plot text, the target plot type corresponding to the plot text through a pre-trained plot type acquisition model according to the plot text.
  • the text segmentation model includes a sentence feature acquisition sub-model and a text segmentation sub-model; the text acquisition module 402 is also used for:
  • For each target sentence obtain the character vector corresponding to each character in the target sentence, and input a plurality of the character vectors corresponding to the target sentence into the sentence feature acquisition sub-model in the text segmentation model, and obtain the corresponding character vector of the target sentence sentence features;
  • At least one plot text corresponding to the target text is obtained through the text segmentation sub-model in the text segmentation model.
  • the sentence feature includes a forward sentence feature and a reverse sentence feature
  • the forward sentence feature is a feature corresponding to the target sentence of the first word order
  • the reverse sentence feature is a feature corresponding to the target sentence of the second word order
  • the first word order is opposite to the second word order
  • FIG. 5 is a block diagram of a second device for determining a text plot type according to an exemplary embodiment of the present disclosure. As shown in FIG. 5 , the device further includes:
  • the spliced text acquisition module 404 is used for splicing forward sentence features and reverse sentence features corresponding to the target sentence for each target sentence, so as to obtain the spliced sentence features corresponding to the target sentence;
  • the text acquisition module 402 is also used for:
  • At least one plot text corresponding to the target text is obtained through the text division sub-model.
  • the text acquisition module 402 is also used to:
  • At least one plot text corresponding to the target text is determined according to the identification information of the multiple target sentences.
  • the identification information includes an initial identification, an intermediate identification, and an end identification;
  • the text acquisition module 402 is also used for:
  • the target start sentence corresponding to the target start tag, the target end sentence corresponding to the target end tag, and the target intermediate sentence corresponding to the target intermediate tag are used as a plot text; wherein, the target start tag is one of the multiple start tags Any start identifier of , the target end identifier is the first end identifier after the target start identifier, and the target intermediate identifier includes an intermediate identifier between the target start identifier and the target end identifier.
  • the type acquisition module 403 is also used for:
  • the target plot type corresponding to the plot text is determined.
  • the type acquisition module 403 is also used for:
  • the preset plot type with the highest probability value among the multiple preset plot types is used as the target plot type corresponding to the plot text.
  • FIG. 6 is a block diagram of a third device for determining a text plot type according to an exemplary embodiment of the present disclosure. As shown in 6, the device further includes:
  • the multimedia information acquisition module 405 is configured to determine the multimedia information corresponding to the plot text according to the target plot type corresponding to the plot text, so as to display the multimedia information when displaying the plot text.
  • At least one target plot type corresponding to the target text can be obtained through the text division model and the plot type acquisition model, so that the text plot type can be determined without manual operation, thereby improving the efficiency of making background music.
  • FIG. 7 it shows a schematic structural diagram of an electronic device 700 suitable for implementing the embodiments of the present disclosure.
  • the terminal equipment in the embodiment of the present disclosure may include but not limited to such as mobile phone, notebook computer, digital broadcast receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable multimedia player), vehicle terminal (such as mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers and the like.
  • the electronic device shown in FIG. 7 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
  • an electronic device 700 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) Various appropriate actions and processes are executed by programs in the memory (RAM) 703 . In the RAM 703, various programs and data necessary for the operation of the electronic device 700 are also stored.
  • the processing device 701, ROM 702, and RAM 703 are connected to each other through a bus 704.
  • An input/output (I/O) interface 705 is also connected to the bus 704 .
  • the following devices can be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 707 such as a computer; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709.
  • the communication means 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. While FIG. 7 shows electronic device 700 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 709, or from storage means 708, or from ROM 702.
  • the processing device 701 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: acquires multiple target sentences corresponding to the target text; according to the multiple target sentences, Through the pre-trained text segmentation model, at least one plot text corresponding to the target text is obtained, and the plot text is used to characterize the text of the same plot type; for each plot text, according to the plot text, through pre-training The plot type acquisition model is used to acquire the target plot type corresponding to the plot text.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as "C" or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, using an Internet service provider to connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to connected via the Internet.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the modules involved in the embodiments described in the present disclosure may be implemented by software or by hardware.
  • the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the sentence obtaining module can also be described as "a module for obtaining multiple target sentences corresponding to the target text".
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • Example 1 provides a method for determining a text plot type, including: acquiring multiple target sentences corresponding to the target text; Model, obtain at least one plot text corresponding to the target text, the plot text is used to characterize the text of the same plot type; for each plot text, according to the plot text, obtain a model through the pre-trained plot type, Obtain the target plot type corresponding to the plot text.
  • Example 2 provides the method of Example 1, the text segmentation model includes a sentence feature acquisition sub-model and a text segmentation sub-model; according to a plurality of the target sentences, through pre-training
  • the text segmentation model, obtaining at least one plot text corresponding to the target text includes: for each of the target sentences, obtaining a character vector corresponding to each character in the target sentence, and multiple The character vector is input into the sentence feature acquisition sub-model in the text segmentation model to obtain the sentence feature corresponding to the target sentence; according to a plurality of the sentence features, through the text segmentation sub-model in the text segmentation model, obtain At least one plot text corresponding to the target text.
  • Example 3 provides the method of Example 2, the sentence features include forward sentence features and reverse sentence features, and the forward sentence features are corresponding to the target sentence in the first word order feature, the reverse sentence feature is the feature corresponding to the target sentence of the second word order, and the first word order is opposite to the second word order; in the described text division model according to a plurality of the sentence features Before obtaining at least one plot text corresponding to the target text, the method further includes: for each target sentence, performing forward sentence features and reverse sentence features corresponding to the target sentence Splicing to obtain the spliced sentence features corresponding to the target sentence; according to the plurality of sentence features, through the text segmentation sub-model in the text segmentation model, obtaining at least one plot text corresponding to the target text includes: according to A plurality of the concatenated sentence features are used to obtain at least one plot text corresponding to the target text through the text division sub-model.
  • Example 4 provides the method of Example 2.
  • the corresponding At least one plot text includes: inputting a plurality of sentence features into the text division sub-model to obtain the identification information of the target sentence corresponding to each of the sentence features, and the identification information is used to characterize the target sentence and its adjacent An association relationship between sentences; according to identification information of multiple target sentences, at least one plot text corresponding to the target text is determined.
  • Example 5 provides the method of Example 4, wherein the identification information includes a start identification, an intermediate identification, and an end identification; and determining the target statement according to the identification information of a plurality of target sentences At least one plot text corresponding to the target text includes:
  • the target start statement corresponding to the target start identifier, the target end statement corresponding to the target end identifier, and the target intermediate sentence corresponding to the target intermediate identifier are used as a plot text; wherein, the target start identifier is a plurality of the start Any start identifier in the identifier, the target end identifier is the first end identifier after the target start identifier, and the target intermediate identifier includes a target identifier between the target start identifier and the target end identifier Intermediate logo.
  • Example 6 provides the method of Example 1.
  • obtaining the target plot type corresponding to the plot text includes: The character vector corresponding to each character in the plot text is input into the plot type acquisition model to obtain the probability values of a plurality of preset plot types corresponding to the plot text; according to the probability values, determine the plot text corresponding Target plot type.
  • Example 7 provides the method of Example 6. According to the probability value, determining the target plot type corresponding to the plot text includes: combining multiple preset plot types The preset plot type with the highest probability value is used as the target plot type corresponding to the plot text.
  • Example 8 provides the method of any one of Examples 1-7, and further includes: the method further includes: determining the plot text according to the target plot type corresponding to the plot text Corresponding multimedia information, so that the multimedia information is displayed when the plot text is displayed.
  • Example 9 provides an apparatus for determining a text plot type, including: a statement acquisition module, configured to acquire multiple target sentences corresponding to the target text; a text acquisition module, configured to The target sentence, through the pre-trained text division model, at least one plot text corresponding to the target text is obtained, and the plot text is used to characterize the text of the same plot type; the type acquisition module is used for each of the plot texts The plot text, according to the plot text, obtains the target plot type corresponding to the plot text through a pre-trained plot type acquisition model.
  • Example 10 provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in any one of Examples 1-8 are implemented. .
  • Example 11 provides an electronic device, including: a storage device on which a computer program is stored; a processing device configured to execute the computer program in the storage device to Implement the steps of the method described in any one of Examples 1-8.

Abstract

本公开涉及一种确定文本情节类型的方法、装置、可读介质及电子设备,所述方法包括:获取目标文本对应的多个目标语句;根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。也就是说,本公开可以通过文本划分模型和情节类型获取模型获取该目标文本对应的至少一个目标情节类型,这样,无需人工操作,即可确定文本情节类型,从而提高了制作背景音乐的效率。

Description

确定文本情节类型的方法、装置、可读介质及电子设备
相关申请的交叉引用
本申请基于申请号为202111050758.2、申请日为2021年09月08日,名称为“确定文本情节类型的方法、装置、可读介质及电子设备”的中国专利申请提出,并要求该中国专利申请的优先权,上述中国专利申请的公开内容全文以引入方式并入本文。
技术领域
本公开涉及自然语言处理领域,具体地,涉及一种确定文本情节类型的方法、装置、可读介质及电子设备。
背景技术
随着智能语音相关技术的日益成熟,越来越多的人习惯于用耳朵来感受这个世界,如听广播、新闻、听有声读物等。在有声小说制作中,为了追求声临其境的效果,往往会插入与小说情节相关的背景音乐,而背景音乐与小说情节有关,例如:针对欢喜冤家的情节,可以插入幽默的音乐;针对反派挑衅、不畏强权的情节,可以插入紧张的音乐等。
相关技术中,通过人工的方式确定小说中不同的情节类型,再根据该情节类型自动为小说插入对应的背景音乐,但是,通过人工方式确定情节类型比较耗时,导致制作背景音乐的效率较低。
发明内容
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
第一方面,本公开提供一种确定文本情节类型的方法,所述方法包括:
获取目标文本对应的多个目标语句;
根据将多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;
针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。
第二方面,本公开提供一种确定文本情节类型的装置,所述装置包括:
语句获取模块,用于获取目标文本对应的多个目标语句;
文本获取模块,用于根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;
类型获取模块,用于针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。
第三方面,本公开提供一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现本公开第一方面所述方法的步骤。
第四方面,本公开提供一种电子设备,包括:
存储装置,其上存储有计算机程序;
处理装置,用于执行所述存储装置中的所述计算机程序,以实现本公开第一方面所述方法的步骤。
通过上述技术方案,通过获取目标文本对应的多个目标语句;根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。也就是说,本公开可以通过文本划分模型和情节类型获取模型获取该目标文本对应的至少一个目标情节类型,这样,无需人工操作,即可确定文本情节类型,从而提高了制作背景音乐的效率。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:
图1是根据本公开一示例性实施例示出的一种确定文本情节类型的方法的流程图;
图2是根据本公开一示例性实施例示出的另一种确定文本情节类型的方法的流程图;
图3是根据本公开一示例性实施例示出的一种文本划分模型的示意图;
图4是根据本公开一示例性实施例示出的一种确定文本情节类型的装置的框图;
图5是根据本公开一示例性实施例示出的第二种确定文本情节类型的装置的框图;
图6是根据本公开一示例性实施例示出的第三种确定文本情节类型的装置的框图;
图7是根据本公开一示例性实施例示出的一种电子设备的框图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
图1是根据本公开一示例性实施例示出的一种确定文本情节类型的方法的流程图,如图1所示,该方法可以包括:
S101、获取目标文本对应的多个目标语句。
其中,该目标文本可以包括多个情节文本,示例地,该目标文本中的第1句至第20句为第1个情节文本,第21句至第55句为第2个情节文本,第56句至第100句为第3个情节文本。
在本步骤中,可以通过现有技术的分句方法,获取该目标文本对应的多个目标语句,此处不再赘述。
S102、根据多个目标语句,通过预先训练的文本划分模型,得到该目标文本对应的至少一个情节文本。
其中,该情节文本可以用于表征同一情节类型的文本,该目标文本可以仅包括一个情节文本,即该目标文本整体为一个情节文本,该目标文本也可以包括多个情节文本,该多个情节文本中相邻情节文本的情节类型不同,不相邻的情节文本的情节类型可以相同。该文本划分模型可以通过现有技术的模型训练方法进行训练得到,此处不再赘述。
在本步骤中,在得到该目标文本对应的多个目标语句后,可以将多个目标语句输入该文本划分模型,得到每个目标语句的标识信息,并根据多个目标语句的标识信息,确定该目标文本对应的至少一个情节文本。其中,该标识信息用于表征该目标语句与相邻语句之间的关联关系,该相邻语句可以包括与该目标语句相邻的语句。
S103、针对每个情节文本,根据该情节文本,通过预先训练的情节类型获取模型,获取该情节文本对应的目标情节类型。
在本步骤中,在得到该目标文本对应的至少一个情节文本后,针对每个情节文本,可以将该情节文本输入该情节类型获取模块,得到该情节文本对应的目标情节类型。其中,该情节类型获取模型可以通过现有技术的模型训练方法进行训练得到,此处不再赘述。
采用上述方法,可以通过文本划分模型和情节类型获取模型获取该目标文本对应的至少一个目标情节类型,这样,无需人工操作,即可确定文本情节类型,从而提高了制作背景音乐的效率。
图2是根据本公开一示例性实施例示出的另一种确定文本情节类型的方法的流程图,如图2所示,该方法可以包括:
S201、获取目标文本对应的多个目标语句。
其中,该目标文本可以包括多个情节文本,示例地,以下面斜体文字对应的目标文本为例:
a1如果不是那一天无意中碰到的那一幕,
a2自己应该会享受着四年的大学时光,
a3然后跟城市里所有的白领儿一样,
a4找个工作,
a5安安分分的做自己的市井小民吧。
a6如果当初没有选择参军,
a7这么些年来,
a8发生在自己身上的一切,
a9都不会发生,
a10老爹也不会死在自己眼前,
a11这一切的悲剧都不会发生!
a12啪的一声!
a13清脆的开门声,
a14打断了灿灿的胡思乱想,
a15扭头就看到女人恶狠的眼神,
a16正恶狠狠的瞪着自己。
a17“哼!
a18秧秧一仰脖子,傲骄的从自己身边走过。
a19“你想干嘛”!
a20“你这是什么表情。
a21看着眼前这家伙一副戒备的表情,
a22秧秧就不爽的挑起了眼角,
a23不过,
a24眼底似乎有些挣扎,
a25最后撅着嘴,
a26一脸刁蛮的说,
a27“你……跟我走”!
a28“去哪儿”。
该目标文本包括28个目标语句,a1为该目标文本中的第1个目标语句,a28为该目标文本中的最后1个目标语句。
S202、针对每个目标语句,获取该目标语句中每个字符对应的字符向量,并将该目标语句对应的多个字符向量输入文本划分模型中的语句特征获取子模型,得到该目标语句对应的语句特征。
其中,该文本划分模型可以包括语句特征获取子模型和文本划分子模型,该语句特征获取子模型和该文本划分子模型可以通过现有技术的模型训练方法训练得到,此处不再赘述。该语句特征可以包括正向语句特征和反向语句特征,该正向语句特征和该反向语句特征可以是通过不同语序的目标语句获取的,示例地,该正向语句特征可以是按照该目标文本中目标语句从前往后的顺序获取的每个目标语句的语句特征,该反向语句特征可以是按照该目标文本中目标语句从后往前的顺序获取的每个目标语句的语句特征。
在本步骤中,在得到该目标文本对应的多个目标语句后,针对每个目标语句,可以通过现有技术的方法获取该目标语句中每个字符对应的字符向量,之后,将每个目标语句对应的多个字符向量输入该语句特征获取子模型,得到该目标语句对应的语句特征。
在一种可能的实现方式中,该语句特征获取子模型可以包括正向语句特征获取子模型和反向语句特征获取子模型,该正向语句特征为第一语序的目标语句对应的特征,该反向语句特征为第二语序的目标语句对应的特征,该第一语序与该第二语序相反,通过该正向语句特征获取子模型可以获取该目标语句对应的正向语句特征,通过该反向语句特征获取子模型可以获取该目标语句对应的反向语句特征,示例地,该语句特征获取子模型可以是基于双向LSTM(Long Short-Term Memory,长短期记忆)神经网络模型,将该目标文本对应的多个目标语句输入该双向LSTM神经网络模型后,可以得到每个目标语句对应的正向语句特征和反向语句特征。
示例地,图3是根据本公开一示例性实施例示出的一种文本划分模型的示意图,如图3所示,该语句特征获取子模型为实线框部分(双向LTSM神经网络模型),该文本划分子模型包括LSTM神经网络模型、全连接层以及CRF(Conditional Random Fields,条件随机场)层。继续以步骤S201中的目标文本为例,在得到该目标文本对应的28个目标语句后,针对每个目标语句,可以获取该目标语句中每个字符对应的字符向量,之后,将每个目标语句对应的多个字符向量输入该语句特征获取子模型,如图3所示,每个目标语句中的每个字符向量均输入该双向LSTM神经网络模型,每个目标语句中最后一个字符处理完成后得到的字符特征为该目标语句对应的语句特征。
S203、根据多个语句特征,通过该文本划分模型中的文本划分子模型,得到该目标文本对应的至少一个情节文本。
在本步骤中,在得到每个目标语句对应的语句特征后,可以将多个目标语句对应的语句特征输入该文本划分子模型,得到每个语句特征对应的目标语句的标识信息,该标识信息用于表征该目标语句与相邻语句之间的关联关系,并根据多个目标语句的标识信息,确定该目标文本对应的至少一个情节文本。
该标识信息可以包括起始标识、中间标识以及终止标识,在根据多个目标语句的标识信息,确定该目标文本对应的至少一个情节文本时,可以将目标起始标识对应的目标起始语句、目标终止标识对应的目标终止语句以及目标中间标识对应的目标中间语句,作为一个情节文本;其中,该目标起始标识为多个起始标识中的任一起始标识,示例地,该起始标识包括多个,可以先从多个起始标识中确定目标起始标识,例如,可以按照指定顺序,依次将每个起始标识作为该目标起始标识;该目标终止标识为该目标起始标识之后的第一个终止标识,该目标中间标识包括位于该目标起始标识和该目标终止标识之间的中间标识。
示例地,本公开可以采用BME序列标注方法标注该目标语句的标识信息,该起始标识可以是B,该中间标识可以是M,该终止标识可以是E。以步骤S201的目标文本为例,目标语句a1为该目标文本的第1个目标语句,a1的标识信息可以是B,若得到的a2~a10的标识信息为M,a11的标识信息为E,则可以确定a1-a11为该目标文本中的第1个情节文本,若得到的a12的标识信息为B,a13~a27的标识信息为M,a28的标识信息为E,则可以确定a12~a28为该目标文本中的第2个情节文本。
在一种可能的实现方式中,在该语句特征包括正向语句特征和反向语句特征的情况下,针对每个目标语句,可以将该目标语句对应的正向语句特征和反向语句特征进行拼接,得到该目标语句对应的拼接语句特征,示例地,可以通过concat方法将该目标语句对应的正向语句特征和反向语句特征进行拼接,之后,可以根据多个拼接语句特征,通过该文本划分子模型,得到该目标文本对应的至少一个情节文本。
示例地,继续以步骤S201中的目标文本为例,在得到每个目标语句对应的正向语句特征和反向语句特征后,如图3所示,可以将该正向语句特征和该反向语句特征进行拼接,并将拼接后的拼接语句特征输入该文本划分子模型中的LSTM神经网络模型(图中未示出拼接的过程),之后,再经过全连接层和CRF层处理后,输出每个语句特征对应的目标语句的标识信息。
S204、针对每个情节文本,将该情节文本中每个字符对应的字符向量输入该情节类型获取模型,得到该情节文本对应的多个预设情节类型的概率值。
其中,该情节类型获取模型可以由Transformer、全连接层以及softmax构成。
S205、根据该概率值,确定该情节文本对应的目标情节类型。
在本步骤中,在得到该情节文本对应的多个预设情节类型的概率值后,可以将多个预设情节类型中概率值最大的预设情节类型,作为该情节文本对应的目标情节类型。示例地,若该预设情节类型包括独白、欢喜冤家、反派挑衅,独白的概率值为1%,欢喜冤家的概率值为0.5%,反派挑衅的概率值为98.5%,则可以确定该情节文本对应的目标情节类型为反派挑衅。
S206、根据该情节文本对应的目标情节类型,确定该情节文本对应的多媒体信息。
其中,该多媒体信息可以是背景音乐、背景图片等,本公开对此不作限定。
在本步骤中,在得到该情节文本对应的目标情节类型后,可以通过预先设置的多媒体信息关联关系,确定该目标情节类型对应的多媒体信息,该多媒体信息关联关系可以包括不同的目标情节类型和多媒体信息之间的对应关系。之后,在展示该情节文本时,可以同步展示该多媒体信息,以该多媒体信息为背景音乐为例,在展示该情节文本时,可以展示对应的背景音乐,从而可以提高文本阅读的体验。
采用上述方法,可以根据目标语句对应的多个字符向量,通过语句特征获取子模型获取目标文本中每个目标语句的语句特征,将多个语句特征作为文本划分子模型的输入,得到每个语句特征对应的目标语句的标识信息,根据该标识信息确定该目标文本对应的至少一个情节文本,最后,再通过情节类型获取模块确定该情节文本对应的目标情节类型,这样,无需人工操作,即可确定文本情节类型,从而提高了制作背景音乐的效率;另外,由于该语句特征是根据目标语句中每个字符对应的字符向量得到的,因此,在确定情节文本过程中同时体现了目标文本的字符级别和语句级别的信息,使得确定的情节文本的准确率更高,从而提高了确定的目标文本的多媒体信息的准确率。
图4是根据本公开一示例性实施例示出的一种确定文本情节类型的装置的框图,如图4所示,该装置可以包括:
语句获取模块401,用于获取目标文本对应的多个目标语句;
文本获取模块402,用于根据多个该目标语句,通过预先训练的文本划分模型,得到该目标文本对应的至少一个情节文本,该情节文本用于表征同一情节类型的文本;
类型获取模块403,用于针对每个该情节文本,根据该情节文本,通过预先训练的情节类型获取模型,获取该情节文本对应的目标情节类型。
可选地,该文本划分模型包括语句特征获取子模型和文本划分子模型;该文本获取模块402,还用于:
针对每个该目标语句,获取该目标语句中每个字符对应的字符向量,并将该目标语句对应的多个该字符向量输入该文本划分模型中的语句特征获取子模型,得到该目标语句对应的语句特征;
根据多个该语句特征,通过该文本划分模型中的文本划分子模型,得到该目标文本对应的至少一个情节文本。
可选地,该语句特征包括正向语句特征和反向语句特征,该正向语句特征为第一语序的目标语句对应的特征,该反向语句特征为第二语序的目标语句对应的特征,该第一语序与该第二语序相反;图5是根据本公开一示例性实施例示出的第二种确定文本情节类型的装置的框图,如图5所示,该装置还包括:
拼接文本获取模块404,用于针对每个该目标语句,将该目标语句对应的正向语句特征和反向语句特征进行拼接,得到该目标语句对应的拼接语句特征;
该文本获取模块402,还用于:
根据多个该拼接语句特征,通过该文本划分子模型,得到该目标文本对应的至少一个情节文本。
可选地,该文本获取模块402,还用于:
将多个该语句特征输入该文本划分子模型,得到每个该语句特征对应的目标语句的标识信息,该标识信息用于表征该目标语句与相邻语句之间的关联关系;
根据多个该目标语句的标识信息,确定该目标文本对应的至少一个情节文本。
可选地,该标识信息包括起始标识、中间标识以及终止标识;该文本获取模块402,还用于:
将目标起始标识对应的目标起始语句、目标终止标识对应的目标终止语句以及目标中间标识对应的目标中间语句,作为一个情节文本;其中,该目标起始标识为多个该起始标识中的任一起始标识,该目标终止标识为该目标起始标识之后的第一个终止标识,该目标中间标识包括位于该目标起始标识和该目标终止标识之间的中间标识。
可选地,该类型获取模块403,还用于:
将该情节文本中每个字符对应的字符向量输入该情节类型获取模型,得到该情节文本对应的多个预设情节类型的概率值;
根据该概率值,确定该情节文本对应的目标情节类型。
可选地,该类型获取模块403,还用于:
将多个该预设情节类型中概率值最大的预设情节类型,作为该情节文本对应的目标情节类型。
可选地,图6是根据本公开一示例性实施例示出的第三种确定文本情节类型的装置的框图,如6所示,该装置还包括:
多媒体信息获取模块405,用于根据该情节文本对应的目标情节类型,确定该情节文本对应的多媒体信息,以便展示所述情节文本时展示所述多媒体信息。
通过上述装置,可以通过文本划分模型和情节类型获取模型获取该目标文本对应的至少一个目标情节类型,这样,无需人工操作,即可确定文本情节类型,从而提高了制作背景音乐的效率。
下面参考图7,其示出了适于用来实现本公开实施例的电子设备700的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图7示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图7所示,电子设备700可以包括处理装置(例如中央处理器、图形处理器等)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储装置708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有电子设备700操作所需的各种程序和数据。处理装置701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。
通常,以下装置可以连接至I/O接口705:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置706;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置707;包括例如磁带、硬盘等的存储装置708;以及通信装置709。通信装置709可以允许电子设备700与其他设备进行无线或有线通信以交换数据。虽然图7示出了具有各种装置的电子设备700,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置709从网络上被下载和安装,或者从存储装置708被安装,或者从ROM 702被安装。在该计算机程序被处理装置701执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”), 网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取目标文本对应的多个目标语句;根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,语句获取模块还可以被描述为“获取目标文本对应的多个目标语句的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,示例1提供了一种确定文本情节类型的方法,包括:获取目标文本对应的多个目标语句;根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。
根据本公开的一个或多个实施例,示例2提供了示例1的方法,所述文本划分模型包括语句特征获取子模型和文本划分子模型;所述根据多个所述目标语句,通过预先训练的文本划分模型,得到所 述目标文本对应的至少一个情节文本包括:针对每个所述目标语句,获取所述目标语句中每个字符对应的字符向量,并将所述目标语句对应的多个所述字符向量输入所述文本划分模型中的语句特征获取子模型,得到所述目标语句对应的语句特征;根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本。
根据本公开的一个或多个实施例,示例3提供了示例2的方法,所述语句特征包括正向语句特征和反向语句特征,所述正向语句特征为第一语序的目标语句对应的特征,所述反向语句特征为第二语序的目标语句对应的特征,所述第一语序与所述第二语序相反;在所述根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本前,所述方法还包括:针对每个所述目标语句,将所述目标语句对应的正向语句特征和反向语句特征进行拼接,得到所述目标语句对应的拼接语句特征;所述根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本包括:根据多个所述拼接语句特征,通过所述文本划分子模型,得到所述目标文本对应的至少一个情节文本。
根据本公开的一个或多个实施例,示例4提供了示例2的方法,所述根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本包括:将多个所述语句特征输入所述文本划分子模型,得到每个所述语句特征对应的目标语句的标识信息,所述标识信息用于表征所述目标语句与相邻语句之间的关联关系;根据多个所述目标语句的标识信息,确定所述目标文本对应的至少一个情节文本。
根据本公开的一个或多个实施例,示例5提供了示例4的方法,所述标识信息包括起始标识、中间标识以及终止标识;所述根据多个所述目标语句的标识信息,确定所述目标文本对应的至少一个情节文本包括:
将目标起始标识对应的目标起始语句、目标终止标识对应的目标终止语句以及目标中间标识对应的目标中间语句,作为一个情节文本;其中,所述目标起始标识为多个所述起始标识中的任一起始标识,所述目标终止标识为所述目标起始标识之后的第一个终止标识,所述目标中间标识包括位于所述目标起始标识和所述目标终止标识之间的中间标识。
根据本公开的一个或多个实施例,示例6提供了示例1的方法,所述根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型包括:将所述情节文本中每个字符对应的字符向量输入所述情节类型获取模型,得到所述情节文本对应的多个预设情节类型的概率值;根据所述概率值,确定所述情节文本对应的目标情节类型。
根据本公开的一个或多个实施例,示例7提供了示例6的方法,所述根据所述概率值,确定所述情节文本对应的目标情节类型包括:将多个所述预设情节类型中概率值最大的预设情节类型,作为所述情节文本对应的目标情节类型。
根据本公开的一个或多个实施例,示例8提供了示例1-7任一示例的方法,还包括:所述方法还包括:根据所述情节文本对应的目标情节类型,确定所述情节文本对应的多媒体信息,以便展示所述情节文本时展示所述多媒体信息。
根据本公开的一个或多个实施例,示例9提供了一种确定文本情节类型的装置,包括:语句获取模块,用于获取目标文本对应的多个目标语句;文本获取模块,用于根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;类型获取模块,用于针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。
根据本公开的一个或多个实施例,示例10提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现示例1-8中任一示例所述方法的步骤。
根据本公开的一个或多个实施例,示例11提供了一种电子设备,包括:存储装置,其上存储有计算机程序;处理装置,用于执行所述存储装置中的所述计算机程序,以实现示例1-8中任一示例所述方法的步骤。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。

Claims (11)

  1. 一种确定文本情节类型的方法,其特征在于,所述方法包括:
    获取目标文本对应的多个目标语句;
    根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;
    针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型。
  2. 根据权利要求1所述的方法,其特征在于,所述文本划分模型包括语句特征获取子模型和文本划分子模型;所述根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本包括:
    针对每个所述目标语句,获取所述目标语句中每个字符对应的字符向量,并将所述目标语句对应的多个所述字符向量输入所述文本划分模型中的语句特征获取子模型,得到所述目标语句对应的语句特征;
    根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本。
  3. 根据权利要求2所述的方法,其特征在于,所述语句特征包括正向语句特征和反向语句特征,所述正向语句特征为第一语序的目标语句对应的特征,所述反向语句特征为第二语序的目标语句对应的特征,所述第一语序与所述第二语序相反;在所述根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本前,所述方法还包括:
    针对每个所述目标语句,将所述目标语句对应的正向语句特征和反向语句特征进行拼接,得到所述目标语句对应的拼接语句特征;
    所述根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本包括:
    根据多个所述拼接语句特征,通过所述文本划分子模型,得到所述目标文本对应的至少一个情节文本。
  4. 根据权利要求2所述的方法,其特征在于,所述根据多个所述语句特征,通过所述文本划分模型中的文本划分子模型,得到所述目标文本对应的至少一个情节文本包括:
    将多个所述语句特征输入所述文本划分子模型,得到每个所述语句特征对应的目标语句的标识信息,所述标识信息用于表征所述目标语句与相邻语句之间的关联关系;
    根据多个所述目标语句的标识信息,确定所述目标文本对应的至少一个情节文本。
  5. 根据权利要求4所述的方法,其特征在于,所述标识信息包括起始标识、中间标识以及终止标识;所述根据多个所述目标语句的标识信息,确定所述目标文本对应的至少一个情节文本包括:
    将目标起始标识对应的目标起始语句、目标终止标识对应的目标终止语句以及目标中间标识对应的目标中间语句,作为一个情节文本;其中,所述目标起始标识为多个所述起始标识中的任一起始标识,所述目标终止标识为所述目标起始标识之后的第一个终止标识,所述目标中间标识包括位于所述目标起始标识和所述目标终止标识之间的中间标识。
  6. 根据权利要求1所述的方法,其特征在于,所述根据所述情节文本,通过预先训练的情节类型获取模型,获取所述情节文本对应的目标情节类型包括:
    将所述情节文本中每个字符对应的字符向量输入所述情节类型获取模型,得到所述情节文本对应的多个预设情节类型的概率值;
    根据所述概率值,确定所述情节文本对应的目标情节类型。
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述概率值,确定所述情节文本对应的目标情节类型包括:
    将多个所述预设情节类型中概率值最大的预设情节类型,作为所述情节文本对应的目标情节类型。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:
    根据所述情节文本对应的目标情节类型,确定所述情节文本对应的多媒体信息,以便展示所述情节文本时展示所述多媒体信息。
  9. 一种确定文本情节类型的装置,其特征在于,所述装置包括:
    语句获取模块,用于获取目标文本对应的多个目标语句;
    文本获取模块,用于根据多个所述目标语句,通过预先训练的文本划分模型,得到所述目标文本对应的至少一个情节文本,所述情节文本用于表征同一情节类型的文本;
    类型获取模块,用于针对每个所述情节文本,根据所述情节文本,通过预先训练的情节类型获取 模型,获取所述情节文本对应的目标情节类型。
  10. 一种计算机可读介质,其上存储有计算机程序,其特征在于,该程序被处理装置执行时实现权利要求1-8中任一项所述方法的步骤。
  11. 一种电子设备,其特征在于,包括:
    存储装置,其上存储有计算机程序;
    处理装置,用于执行所述存储装置中的所述计算机程序,以实现权利要求1-8中任一项所述方法的步骤。
PCT/CN2022/117160 2021-09-08 2022-09-06 确定文本情节类型的方法、装置、可读介质及电子设备 WO2023036101A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111050758.2A CN113722491A (zh) 2021-09-08 2021-09-08 确定文本情节类型的方法、装置、可读介质及电子设备
CN202111050758.2 2021-09-08

Publications (1)

Publication Number Publication Date
WO2023036101A1 true WO2023036101A1 (zh) 2023-03-16

Family

ID=78682737

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/117160 WO2023036101A1 (zh) 2021-09-08 2022-09-06 确定文本情节类型的方法、装置、可读介质及电子设备

Country Status (2)

Country Link
CN (1) CN113722491A (zh)
WO (1) WO2023036101A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722491A (zh) * 2021-09-08 2021-11-30 北京有竹居网络技术有限公司 确定文本情节类型的方法、装置、可读介质及电子设备
CN115101032A (zh) * 2022-06-17 2022-09-23 北京有竹居网络技术有限公司 用于生成文本的配乐的方法、装置、电子设备和介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190197105A1 (en) * 2017-12-21 2019-06-27 International Business Machines Corporation Unsupervised neural based hybrid model for sentiment analysis of web/mobile application using public data sources
CN111339255A (zh) * 2020-02-26 2020-06-26 腾讯科技(深圳)有限公司 目标情感分析的方法、模型训练方法、介质和设备
CN111782576A (zh) * 2020-07-07 2020-10-16 北京字节跳动网络技术有限公司 背景音乐的生成方法、装置、可读介质、电子设备
CN113312906A (zh) * 2021-06-23 2021-08-27 北京有竹居网络技术有限公司 划分文本的方法、装置、存储介质及电子设备
CN113722491A (zh) * 2021-09-08 2021-11-30 北京有竹居网络技术有限公司 确定文本情节类型的方法、装置、可读介质及电子设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710759B (zh) * 2018-12-17 2021-06-08 北京百度网讯科技有限公司 文本切分方法、装置、计算机设备和可读存储介质
CN109960725A (zh) * 2019-01-17 2019-07-02 平安科技(深圳)有限公司 基于情感的文本分类处理方法、装置和计算机设备
CN111985229B (zh) * 2019-05-21 2023-07-07 腾讯科技(深圳)有限公司 一种序列标注方法、装置及计算机设备
CN110222654A (zh) * 2019-06-10 2019-09-10 北京百度网讯科技有限公司 文本分割方法、装置、设备及存储介质
CN111767740A (zh) * 2020-06-23 2020-10-13 北京字节跳动网络技术有限公司 音效添加方法和装置、存储介质和电子设备
CN111930950B (zh) * 2020-09-18 2021-04-06 深圳追一科技有限公司 多意图响应方法、装置、计算机设备和存储介质
CN112231447B (zh) * 2020-11-21 2023-04-07 杭州投知信息技术有限公司 一种中文文档事件抽取的方法和系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190197105A1 (en) * 2017-12-21 2019-06-27 International Business Machines Corporation Unsupervised neural based hybrid model for sentiment analysis of web/mobile application using public data sources
CN111339255A (zh) * 2020-02-26 2020-06-26 腾讯科技(深圳)有限公司 目标情感分析的方法、模型训练方法、介质和设备
CN111782576A (zh) * 2020-07-07 2020-10-16 北京字节跳动网络技术有限公司 背景音乐的生成方法、装置、可读介质、电子设备
CN113312906A (zh) * 2021-06-23 2021-08-27 北京有竹居网络技术有限公司 划分文本的方法、装置、存储介质及电子设备
CN113722491A (zh) * 2021-09-08 2021-11-30 北京有竹居网络技术有限公司 确定文本情节类型的方法、装置、可读介质及电子设备

Also Published As

Publication number Publication date
CN113722491A (zh) 2021-11-30

Similar Documents

Publication Publication Date Title
WO2023036101A1 (zh) 确定文本情节类型的方法、装置、可读介质及电子设备
CN111368185B (zh) 数据展示方法、装置、存储介质及电子设备
WO2021196903A1 (zh) 视频处理方法、装置、可读介质及电子设备
WO2021008223A1 (zh) 信息的确定方法、装置及电子设备
WO2020238320A1 (zh) 用于生成表情包的方法和装置
WO2022247562A1 (zh) 多模态数据检索方法、装置、介质及电子设备
CN110969012A (zh) 文本纠错方法、装置、存储介质及电子设备
WO2021259300A1 (zh) 音效添加方法和装置、存储介质和电子设备
CN110516159B (zh) 一种信息推荐方法、装置、电子设备及存储介质
WO2022037419A1 (zh) 音频内容识别方法、装置、设备和计算机可读介质
CN110990598B (zh) 资源检索方法、装置、电子设备及计算机可读存储介质
WO2023279843A1 (zh) 内容搜索方法、装置、设备和存储介质
WO2023138314A1 (zh) 对象属性识别方法、装置、可读存储介质及电子设备
WO2023273596A1 (zh) 确定文本相关性的方法、装置、可读介质及电子设备
CN112287206A (zh) 信息处理方法、装置和电子设备
WO2023142913A1 (zh) 视频处理方法、装置、可读介质及电子设备
WO2022156413A1 (zh) 语音风格的迁移方法、装置、可读介质和电子设备
US20240040069A1 (en) Image special effect configuration method, image recognition method, apparatus and electronic device
CN111667810B (zh) 多音字语料的获取方法、装置、可读介质和电子设备
CN111629156A (zh) 图像特效的触发方法、装置和硬件装置
CN110379406B (zh) 语音评论转换方法、系统、介质和电子设备
CN112182255A (zh) 用于存储媒体文件和用于检索媒体文件的方法和装置
CN116128055A (zh) 图谱构建方法、装置、电子设备和计算机可读介质
CN110413834B (zh) 语音评论修饰方法、系统、介质和电子设备
WO2022161122A1 (zh) 一种会议纪要的处理方法、装置、设备及介质

Legal Events

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

Ref document number: 22866564

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE