Method for constructing feature dictionary, device thereof, electronic device, and program product

By using word vectors and smoothed inverse frequency models to construct feature dictionaries in the financial field, the problem of low efficiency in feature dictionary construction is solved, and automated and efficient feature dictionary construction is achieved, which is suitable for information retrieval in the financial field.

CN119670745BActive Publication Date: 2025-10-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411706958.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-10-21
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

The existing technology has low efficiency in constructing feature dictionaries, relies on manual construction and is difficult to adapt to big data environments. It also lacks automated and unsupervised dictionary construction methods.

Method used

A preset word vector extraction model is used to extract word vectors from financial texts marked with parts of speech. The preset smoothed inverse frequency model is combined to determine the sentence vectors and similarity values, screen out the feature word set, and construct a feature dictionary in the financial field.

Benefits of technology

It realizes the automated construction of feature dictionaries, improves construction efficiency, reduces labor costs, adapts to big data environments, and can be efficiently applied in the financial field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119670745B_ABST
    Figure CN119670745B_ABST
Patent Text Reader

Abstract

The application discloses a feature dictionary construction method and device, an electronic device and a program product, and relates to the technical field of finance. The construction method comprises the following steps: a preset word vector extraction model is used to extract the word vector of each preset word from a preset text; a preset smoothing inverse frequency model is used to determine the sentence vector corresponding to each word vector; the similarity value corresponding to each word vector is determined based on the word vector and the sentence vector corresponding to the word vector; the preset words in the preset text are screened based on the similarity value, so that the feature word set corresponding to the preset text is obtained; and the feature dictionary of the financial field is constructed based on the feature word set corresponding to each preset text. The application solves the technical problem of low efficiency in constructing the feature dictionary in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a method for constructing a feature dictionary, a device thereof, an electronic device, and a program product. Background Art

[0002] With the continuous development of Internet finance, financial business has gradually shifted from traditional models to Internet models. In the era of big data, intelligence, mobile Internet and cloud computing, a large amount of unstructured financial information has been generated. In order to make full use of this information, it is necessary to use natural language processing technology to extract valuable and structured data from text.

[0003] Feature words reveal the subject matter and nature of a text and effectively summarize its characteristics. Feature dictionaries are collections of feature words extracted from various texts. In the financial sector, feature dictionaries can serve as prior knowledge to assist in various downstream tasks (i.e., applying feature dictionaries to solve specific business problems, such as information retrieval). However, the construction of feature dictionaries primarily relies on manual methods, which require a high level of expertise and are inefficient, making them difficult to adapt to the current big data environment.

[0004] Currently, although the application of technologies such as machine learning, deep learning neural networks, and large models in natural language processing is becoming increasingly widespread, they cannot be directly applied to the construction of feature dictionaries, nor can a complete and authoritative domain dictionary be built for the financial field. There is also a lack of research on automated and unsupervised dictionary construction.

[0005] To the above problems, no effective solution has been proposed yet. Summary of the Invention

[0006] The embodiments of the present invention provide a method for constructing a feature dictionary, an apparatus thereof, an electronic device, and a program product thereof, to at least solve the technical problem of low efficiency in constructing a feature dictionary in related technologies.

[0007] According to one aspect of an embodiment of the present invention, a method for constructing a feature dictionary is provided, comprising: extracting a word vector for each preset word from a preset text using a preset word vector extraction model, wherein the preset text is a text pre-marked with parts of speech, the preset text records financial information in the financial field, and the preset words are words in the preset text whose part of speech is noun; determining a sentence vector corresponding to each of the word vectors using a preset smooth inverse frequency model, and determining a similarity value corresponding to each of the word vectors based on the word vectors and the sentence vectors corresponding to the word vectors; screening the preset words in the preset text based on the similarity values ​​to obtain a feature word set corresponding to the preset text; and constructing a feature dictionary in the financial field based on the feature word set corresponding to each of the preset texts.

[0008] Furthermore, before using a preset word vector extraction model to extract the word vector of each preset word from a preset text, it includes: using a preset word segmentation model to segment the preset text to obtain an initial word set of the preset text, and using a preset part-of-speech tagging model to determine the part of speech of each initial word in the initial word set; and determining the initial word whose part of speech is the noun part of speech as the preset word.

[0009] Furthermore, the step of using a preset smooth inverse frequency model to determine the sentence vector corresponding to each of the word vectors includes: determining a first preset parameter corresponding to each of the preset words, and determining a first preset smoothing item based on the frequency of occurrence of the preset words in the preset text, the first preset parameter and the word vector; determining a preset common discourse vector based on the sentence in which the preset words are located, and determining the frequency of occurrence of the preset sentence in the sentence based on the preset common discourse volume; determining the frequency of occurrence of the preset sentence in the sentence as a second preset smoothing item; and determining the sentence vector corresponding to the word vector based on the first preset smoothing item and the second preset smoothing item.

[0010] Furthermore, the step of determining the similarity value corresponding to each word vector based on the word vector and the sentence vector corresponding to the word vector includes: determining a first module length of the word vector and determining a second module length of the sentence vector corresponding to the word vector; determining an initial similarity based on the word vector, the sentence vector corresponding to the word vector, the first module length and the second module length; determining a preset position where the preset word first appears in the preset text, and calculating a position weight of the preset word based on the preset position and a second preset parameter; and determining the similarity value based on the position weight and the initial similarity.

[0011] Furthermore, the step of determining the similarity value based on the position weight and the initial similarity includes: determining the normalized weight of each of the preset words based on the position weights of all the preset words; and determining the similarity value based on the normalized weight and the initial similarity.

[0012] Furthermore, based on the feature word set corresponding to each of the preset texts, the step of constructing the feature dictionary in the financial field includes: for each of the feature word sets, determining the word frequency of each feature word in the feature word set in the preset text; based on all the word frequencies, determining the sorting order of each feature word; based on the sorting order of all the feature words, constructing a basic dictionary; and expanding each of the feature words in the basic dictionary to obtain the feature dictionary, wherein the feature dictionary is at least used for information retrieval in the financial field.

[0013] Furthermore, the step of expanding each of the feature words in the basic dictionary to obtain the feature dictionary includes: performing part-of-speech expansion on each of the feature words in the basic dictionary to obtain an expanded part-of-speech set corresponding to each of the feature words; performing synonym expansion on each of the feature words in the basic dictionary to obtain a synonym set corresponding to each of the feature words; performing regular matching on each of the feature words in the basic dictionary to obtain a missing word set corresponding to each of the feature words; and adding the expanded part-of-speech set, the synonym set and the missing word set corresponding to each of the feature words to the basic dictionary to obtain the feature dictionary.

[0014] According to another aspect of an embodiment of the present invention, a device for constructing a feature dictionary is also provided, including: an extraction unit, configured to extract a word vector of each preset word from a preset text using a preset word vector extraction model, wherein the preset text is a text pre-marked with parts of speech, the preset text records financial information in the financial field, and the preset words are words in the preset text whose part of speech is noun; a determination unit, configured to determine a sentence vector corresponding to each of the word vectors using a preset smooth inverse frequency model, and determine a similarity value corresponding to each of the word vectors based on the word vectors and the sentence vectors corresponding to the word vectors; a screening unit, configured to screen the preset words in the preset text based on the similarity value to obtain a feature word set corresponding to the preset text; and a construction unit, configured to construct a feature dictionary in the financial field based on the feature word set corresponding to each of the preset texts.

[0015] Furthermore, the construction device includes: a first determination module, which is used to use a preset word segmentation model to segment the preset text before using a preset word vector extraction model to extract the word vector of each preset word from the preset text, so as to obtain an initial word set of the preset text, and use a preset part-of-speech tagging model to determine the part of speech of each initial word in the initial word set; a second determination module, which is used to determine the initial word whose part of speech is the noun part of speech as the preset word.

[0016] Furthermore, the determination unit includes: a third determination module, used to determine the first preset parameter corresponding to each of the preset words, and determine the first preset smoothing item based on the frequency of occurrence of the preset words in the preset text, the first preset parameter and the word vector; a fourth determination module, used to determine the preset common discourse vector based on the sentence in which the preset words are located, and determine the frequency of occurrence of the preset sentence in the sentence based on the preset common discourse volume; a fifth determination module, used to determine the frequency of occurrence of the preset sentence in the sentence as the second preset smoothing item; a sixth determination module, used to determine the sentence vector corresponding to the word vector based on the first preset smoothing item and the second preset smoothing item.

[0017] Furthermore, the determination unit also includes: a seventh determination module, used to determine the first modulus of the word vector and determine the second modulus of the sentence vector corresponding to the word vector; an eighth determination module, used to determine the initial similarity based on the word vector, the sentence vector corresponding to the word vector, the first modulus and the second modulus; a first calculation module, used to determine the preset position where the preset word first appears in the preset text, and calculate the position weight of the preset word based on the preset position and the second preset parameter; a ninth determination module, used to determine the similarity value based on the position weight and the initial similarity.

[0018] Furthermore, the ninth determination module includes: a first determination submodule, used to determine the normalized weight of each of the preset words based on the position weights of all the preset words; and a second determination submodule, used to determine the similarity value based on the normalized weight and the initial similarity.

[0019] Furthermore, the construction unit includes: a tenth determination module, used to determine the word frequency of each feature word in the feature word set in the preset text for each feature word set; an eleventh determination module, used to determine the sorting order of each feature word based on all the word frequencies; a first construction module, used to construct a basic dictionary based on the sorting order of all the feature words; a first expansion module, used to expand each feature word in the basic dictionary to obtain the feature dictionary, wherein the feature dictionary is at least used for information retrieval in the financial field.

[0020] Furthermore, the first extension module includes: a first extension submodule, used to perform part-of-speech expansion on each of the feature words in the basic dictionary to obtain an extended part-of-speech set corresponding to each of the feature words; a second extension submodule, used to perform synonym expansion on each of the feature words in the basic dictionary to obtain a synonym set corresponding to each of the feature words; a first matching submodule, used to perform regular matching on each of the feature words in the basic dictionary to obtain a missing word set corresponding to each of the feature words; and a first processing module, used to add the extended part-of-speech set, the synonym set and the missing word set corresponding to each of the feature words to the basic dictionary to obtain the feature dictionary.

[0021] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned feature dictionary construction methods.

[0022] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned feature dictionary construction methods.

[0023] In the present invention, a preset word vector extraction model is adopted to extract the word vector of each preset word from the preset text, a preset smooth inverse frequency model is adopted to determine the sentence vector corresponding to each word vector, and based on the word vector and the sentence vector corresponding to the word vector, the similarity value corresponding to each word vector is determined. Based on the similarity value, the preset words in the preset text are screened to obtain a feature word set corresponding to the preset text. Based on the feature word set corresponding to each preset text, a feature dictionary in the financial field is constructed, which solves the technical problem of low efficiency in constructing feature dictionaries in related technologies.

[0024] In the present invention, a preset word vector extraction model can be used to extract the word vector of each preset word from a text pre-labeled with parts of speech, and a preset smoothed inverse frequency model can be used to obtain the sentence vector corresponding to each word vector. Then, based on the word vector of each preset word and the sentence vector corresponding to each word vector, the similarity value corresponding to each word vector can be calculated. Based on the similarity value, the preset words in the preset text can be sorted and screened to obtain a feature word set corresponding to the preset text. Then, based on the feature word set corresponding to each preset text, a feature dictionary in the financial field can be constructed. In this way, the automatic construction of a feature dictionary can be realized for a variety of data texts in the financial field, reducing labor costs, thereby achieving the technical effect of improving the efficiency of constructing the feature dictionary. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0026] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for constructing a feature dictionary is shown;

[0027] Figure 2 is a flowchart of a method for constructing a feature dictionary according to Example 1 of the present application;

[0028] Figure 3 1 is a schematic diagram of the SIF model structure of an optional fusion word vector extraction model according to an embodiment of the present application;

[0029] Figure 4 is a schematic diagram of an optional process for constructing a feature dictionary according to an embodiment of the present application;

[0030] Figure 5 is a schematic diagram of an optional feature dictionary construction device according to an embodiment of the present application;

[0031] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) collected and involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set up between this system and the relevant users or institutions. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or institution through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or institution.

[0035] In the present invention, since the method of manually constructing a dictionary has the problems of low efficiency and dependence on the professional level of the builders themselves, the present invention proposes a feature dictionary construction method that integrates multiple models, relying on statistical information and pre-trained word vector extraction models, sentence vector extraction models and other technologies. When constructing the dictionary, the particularity of the field (such as the financial field) can be considered, and the diversity of the semantic features of things can be combined to construct a field-specific feature dictionary, which can realize automatic and efficient construction of feature dictionaries under various data scales.

[0036] The present invention will be described in detail below with reference to various embodiments.

[0037] Example 1

[0038] According to an embodiment of the present application, an embodiment of a method for constructing a feature dictionary is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0039] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for constructing a feature dictionary. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more ( Figure 1 102a, 102b, ..., 102n are used to illustrate) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera, wherein the network interface may be connected to a wired and / or wireless network. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0040] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for constructing a feature dictionary in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizes the method for constructing the feature dictionary mentioned above. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0042] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0043] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0044] Under the above operating environment, this application provides Figure 2 The construction method of the feature dictionary shown. Figure 2 is a flowchart of a method for constructing a feature dictionary according to Example 1 of the present application, such as Figure 2 As shown, the method includes the following steps:

[0045] Step S201, using a preset word vector extraction model to extract a word vector for each preset word from a preset text, wherein the preset text is a text pre-marked with parts of speech, the preset text records financial information in the financial field, and the preset word is a word in the preset text whose part of speech is a noun.

[0046] In an embodiment of the present invention, a preset word vector extraction model (i.e., a pre-trained word vector extraction model) can be used to extract the word vector of each preset word (i.e., a word whose part of speech in the preset text is a noun) from a text pre-marked with parts of speech, so as to complete the extraction of the word vector of each preset word in the preset text.

[0047] Optionally, the preset word vector extraction model can adopt a pre-trained BERT (Bidirectional Encoder Representations from Transformers, i.e., bidirectional encoder representations based on Transformers (a model architecture for natural language processing)) model. Due to its Transformer-based structure, BERT has a high accuracy in word vector extraction.

[0048] Optionally, by collecting desensitized data related to financial institutions (i.e., data that has been desensitized to protect personal privacy), other financial field data (such as financial news report data, etc.), and large-scale financial corpus data sets (such as financial forum discussion data, etc.), and using the collected data to train the BERT model, a pre-trained language model (i.e., a preset word vector extraction model) suitable for the financial institution field can be obtained.

[0049] In the embodiment of the present invention, the words whose part of speech in the preset text is noun may include noun words or noun phrases.

[0050] In step S202 , a preset smoothed inverse frequency model is used to determine a sentence vector corresponding to each word vector, and a similarity value corresponding to each word vector is determined based on the word vector and the sentence vector corresponding to the word vector.

[0051] In an embodiment of the present invention, a preset smooth inverse frequency model (such as SIF (Smooth Inverse Frequency, a model for synthesizing sentence vectors)) can be used to synthesize the sentence vector corresponding to each word vector of the noun word, and based on the sentence vector corresponding to each synthesized word vector, the similarity value corresponding to each word vector (that is, the similarity between each word vector and the sentence vector corresponding to each word vector) is calculated.

[0052] In an embodiment of the present invention, the preset smooth inverse frequency model is a completely unsupervised weighted average sentence vector synthesis method based on a latent variable generation model and a random walk model. The sentence vector extraction using the completely unsupervised weighted average sentence vector synthesis method is better than the unweighted average word vector in keyword extraction. This method improves the traditional sentence vector calculation method by adding two smoothing terms. The sentence vector generated by the SIF model has low dependence on the database and strong portability. As a completely unsupervised method, SIF does not rely on manual labeling and is highly efficient.

[0053] In an optional embodiment, when the preset word is a noun phrase, in the process of determining the sentence vector corresponding to each word vector using the preset smoothed inverse frequency model, the phrase vector of the preset word can be obtained, and then the similarity between the phrase vector of the preset word and the sentence vector corresponding to each word vector is calculated to determine the similarity value corresponding to the phrase vector of each preset word. That is, when the preset word is a noun, the similarity between the word vector of the preset word and the sentence vector corresponding to the word vector is determined; when the preset word is a noun phrase, the similarity between the phrase vector of the preset word and the sentence vector corresponding to the word vector of the preset word is determined.

[0054] Step S203 : Based on the similarity value, the preset words in the preset text are screened to obtain a set of feature words corresponding to the preset text.

[0055] In an embodiment of the present invention, the preset words in the preset text are sorted and filtered according to the calculated similarity value (such as selecting the preset words corresponding to the word vectors with high similarity values ​​as feature words), and based on the preset words after sorting and filtering, a feature word set corresponding to the preset text can be obtained.

[0056] Optionally, the preset text may include multiple sentences, and the preset words corresponding to the word vectors whose word vector similarity values ​​are ranked in the top N (such as 5) in each sentence may be selected as feature words.

[0057] In some optional embodiments, the value of N can be selected as 10.

[0058] Step S204: construct a feature dictionary in the financial field based on the feature word set corresponding to each preset text.

[0059] In the embodiment of the present invention, by screening the preset words in each preset text, a feature word set of each preset text can be obtained respectively. Based on the obtained feature word set of each preset text, a feature dictionary in the financial field can be constructed.

[0060] In an embodiment of the present invention, for feature words that are ranked higher in the financial field feature dictionary, they can represent the semantic features of the original text in the financial field, that is, they have higher importance. An importance sorting strategy can be used to sort the feature words in all feature word sets to construct a feature dictionary in the financial field.

[0061] In summary, the word vector of each preset word can be extracted from the preset text by adopting a preset word vector extraction model, and the sentence vector corresponding to each word vector can be determined by adopting a preset smooth inverse frequency model. Then, based on the word vector and the sentence vector corresponding to the word vector, the similarity value between the word vector and the sentence vector corresponding to the word vector is calculated. According to the similarity value, the preset words corresponding to the word vector are sorted and screened, and a feature word set corresponding to the preset text can be obtained. According to the feature word set corresponding to each preset text, a feature dictionary in the financial field can be constructed, which can extract semantic information from unstructured data and realize the automatic construction of the feature dictionary, thereby solving the technical problem of low efficiency in constructing feature dictionaries in related technologies.

[0062] In order to improve the accuracy of determining preset words, in the feature dictionary construction method provided in Example 1 of the present application, a preset word segmentation model is used to segment the preset text to obtain an initial word set of the preset text, and a preset part-of-speech tagging model is used to determine the part of speech of each initial word in the initial word set; the initial word whose part of speech is a noun is determined as the preset word.

[0063] In an embodiment of the present invention, a preset word segmentation model (such as jieba (a word segmentation tool)) can be used to segment the preset text to obtain an initial word set of the preset text, and a preset part-of-speech tagging model (such as nltk (Natural Language Toolkit, a natural language processing tool)) can be used to determine the part of speech of each initial word in the initial word set.

[0064] In the embodiment of the present invention, since the features of articles or sentences in the financial field are largely represented by nouns or noun phrases, regular expressions can be used to determine words in the preset text whose part of speech is noun as preset words.

[0065] For example, the part-of-speech tag of a noun can be represented by the symbol n, and a regular expression (such as re.match(r'^n',tag) to filter out all parts of speech starting with n (ie nouns)) can be used to obtain words whose part of speech is noun.

[0066] In order to improve the accuracy of determining the sentence vector corresponding to the word vector, in the feature dictionary construction method provided in Example 1 of the present application, the first preset parameter corresponding to each preset word is determined, and based on the frequency of the preset word in the preset text, the first preset parameter and the word vector, the first preset smoothing item is determined; based on the sentence in which the preset word is located, the preset public discourse vector is determined, and based on the preset public discourse volume, the frequency of the preset sentence in the sentence is determined; the frequency of the preset sentence in the sentence is determined as the second preset smoothing item; based on the first preset smoothing item and the second preset smoothing item, the sentence vector corresponding to the word vector is determined.

[0067] In an embodiment of the present invention, since low-frequency words may be ignored because the inner product of their word vector and the discourse vector is very small (that is, the word has little contextual relevance to the entire discourse), a weighting mechanism can be introduced to multiply each word vector by a weight factor (that is, a first preset parameter, such as α), so that low-frequency words can also be included in the calculation process with a higher weight, which can solve the problem that low-frequency words are important in sentences but are ignored.

[0068] In the embodiment of the present invention, the frequency of a preset word (such as word w) in a preset text (such as p(w)), the first preset parameter and the word vector (such as v w ), determine the first preset smoothing term (such as ), where S represents a set of preset words.

[0069] Optionally, based on the sentence containing the preset word, a preset common discourse vector (such as c0) is determined. The preset common discourse vector refers to the principal component of all sentence vector matrices (representing the characteristics or trends common to all sentence vectors). In the SIF model, by subtracting the projection of each word vector on c0, the common components in the word vector can be deleted, so that each word vector can better reflect its uniqueness.

[0070] In the embodiment of the present invention, the frequency of occurrence of a preset sentence in a sentence can be determined according to the preset public speech volume, and the frequency of occurrence of the preset sentence in the sentence can be determined as the second preset smoothing item (such as ), through the first preset smoothing term and the second preset smoothing term (such as ), we can calculate the sentence vector corresponding to the word vector, where Represents the context vector, argmax represents the parameter value that maximizes the sum expression ∝ indicates that the sum expression on the left is proportional to the sum expression on the right.

[0071] In an embodiment of the present invention, the SIF model performs weighted averaging on all word vectors in a sentence. For high-frequency words, smaller weights can be assigned to increase the probability of occurrence of low-frequency words, and the influence of words outside the context in the sentence can be increased by presetting the projection length of the common discourse vector.

[0072] In order to accurately determine the similarity value, in the feature dictionary construction method provided in Example 1 of the present application, the first modulus of the word vector is determined, and the second modulus of the sentence vector corresponding to the word vector is determined; the initial similarity is determined based on the word vector, the sentence vector corresponding to the word vector, the first modulus and the second modulus; the preset position where the preset word first appears in the preset text is determined, and the position weight of the preset word is calculated based on the preset position and the second preset parameter; the similarity value is determined based on the position weight and the initial similarity.

[0073] In the embodiment of the present invention, the modulus of the word vector (i.e., the first modulus, such as ) and the modulus of the sentence vector corresponding to the word vector (i.e., the second modulus, such as ), according to the word vector (such as ), sentence vector corresponding to word vector The first modulus and the second modulus can be used to calculate the initial similarity between the word vector and the sentence vector corresponding to the word vector. The calculation formula can be expressed as:

[0074]

[0075] Optionally, for long sentences or long documents, the most important preset words may appear at the beginning of the long sentence or long document. Since the influence of the preset word position is not taken into account when extracting word vectors and synthesizing sentence vectors, in order to make the results more accurate, the position information can be incorporated into the process of constructing the feature dictionary.

[0076] In the embodiment of the present invention, since the preset word can appear multiple times in a sentence, in order to prevent repeated counting, the position where the preset word first appears in the preset text can be determined as the preset position (such as p), and the position weight of the preset word can be calculated based on the preset position and the second preset parameter (such as u). ), the position weight can be used to increase the extraction effect of the model in long texts, and the similarity value can be determined based on the position weight and the initial similarity.

[0077] In order to improve the accuracy of determining the similarity value, in the feature dictionary construction method provided in Example 1 of the present application, the normalized weight of each preset word is determined based on the position weights of all preset words; and the similarity value is determined based on the normalized weight and the initial similarity.

[0078] In the embodiment of the present invention, the normalized weight of each preset word is determined based on the position weights of all preset words (e.g. N represents the number of preset words), and the similarity value is determined based on the normalized weight and the initial similarity. The calculation formula can be expressed as:

[0079]

[0080] Among them, exp(P(NP i )) represents the exponential weight of the position of the i-th word vector, represents the exponential sum of the position weights of all word vectors, cossim+ represents the optimization of the initial similarity formula, cossimP(NP i ) represents the similarity value corresponding to the i-th word vector.

[0081] Figure 3 is a schematic diagram of the SIF model structure of an optional fusion word vector extraction model according to an embodiment of the present application, such as Figure 3 As shown in the figure, the model structure consists of six parts: word segmentation and part-of-speech tagging, extraction of NP (i.e., noun phrase) or NNP (i.e., singular proper noun), FinBERT (i.e., pre-trained BERT model), SIF, calculation of position weights, and cosine similarity. First, the text to be processed (i.e., the preset text) can be segmented and tagged with parts of speech to obtain the parts of speech of the tagged preset words. Among them, IN represents prepositions, JJ represents adjectives, NN represents singular nouns, NNP represents singular proper nouns, T1, T2, T3, and TN represent the corresponding sequences of the parts of speech of the tagged preset words, NP1 represents noun phrases, and NPM represents singular proper noun combinations. Then, T1, T2, ..., TN extracted by regular matching expressions are input into the FinBERT model (the FinBERT model is a model trained with a large amount of financial corpus, that is, a preset word vector extraction model obtained by pre-training Trm Encode (Transformer Encode, i.e., the encoder in the Transformer model) with multi-task self-supervision using a large amount of financial corpus such as bank-related desensitized data and other financial desensitized corpus). The word vectors (E1, E2, ..., EN) of the preset words can be obtained. The FinBERT model is composed of multiple transformer encoder layers (i.e., multiple Trms). Each encoder layer contains a self-attention mechanism and a feedforward neural network. Each layer processes the input data, where EN represents the word vector of the Nth word output in the FinBERT model. The word vector includes word vectors of different dimensions, where E N,1 Represents the value of the first dimension of the Nth word vector in the sequence, E N,2 Represents the value of the second dimension of the Nth word vector in the sequence, E N,3 Represents the value of the third dimension of the Nth word vector in the sequence. Then the word vector of the preset word can be input into the SIF model to obtain the sentence vector corresponding to the word vector of the preset word (such as sentence vector S1, sentence vector S2, sentence vector S3). In the process of obtaining the sentence vector, if the input preset word is a noun phrase, the noun phrase vector can also be obtained, where the noun phrase vector includes phrase vectors of different dimensions, NP M,1 Represents the value of the first dimension of the Mth noun phrase, NP M,2 Represents the value of the second dimension of the Mth noun phrase, NP M,3Represents the value of the third dimension of the Mth noun phrase. The position of a preset word can be introduced to calculate the position weight. The position weight is then introduced into the cosine similarity calculation to obtain the similarity between the sentence vector and its noun phrase vector, or between the word vector and its sentence vector. Based on this similarity, the feature word can be determined.

[0082] In order to accurately obtain a feature dictionary, in the feature dictionary construction method provided in Example 1 of the present application, for each feature word set, the word frequency of each feature word in the feature word set in the preset text is determined; based on all word frequencies, the sorting order of each feature word is determined; based on the sorting order of all feature words, a basic dictionary is constructed; each feature word in the basic dictionary is expanded to obtain a feature dictionary, wherein the feature dictionary is at least used for information retrieval in the financial field.

[0083] Optionally, a bag-of-words model can be used to calculate the frequency of each feature word in a set of feature words in a preset text. The bag-of-words model is used for text representation, treating the entire text as a bag, without considering the grammatical and word order information between words, and treating each word in the text as an independent, unordered element. Only the frequency information of each word in the text is considered, and the text is then represented by a vector or matrix.

[0084] In an embodiment of the present invention, for each feature word set, each feature word can be sorted according to the frequency of each feature word in the feature word set calculated by the bag-of-words model in the preset text. Based on the sorting of all the feature words obtained, a basic dictionary can be constructed, and each feature word in the basic dictionary can be expanded to obtain a feature dictionary.

[0085] In some optional embodiments, TF-IDF (Term Frequency-Inverse Document Frequency, a weighted technique) can be used to sort each feature word, and then a basic dictionary can be constructed based on the resulting sorting of all feature words, where TF-IDF is the product of TF (Term Frequency, the frequency with which a feature word appears in the text in which it is located) and IDF (Inverse Document Frequency), and IDF is obtained by taking the logarithm of the quotient of the total number of texts divided by the number of texts containing the feature word.

[0086] In an embodiment of the present invention, the constructed feature dictionary can be used for information retrieval tasks in the financial field. Through the constructed feature dictionary, the information retrieval model in the financial field can be trained quickly and accurately to achieve efficient and accurate information retrieval tasks using the model.

[0087] In order to improve the accuracy of determining the feature dictionary, in the feature dictionary construction method provided in Example 1 of the present application, each feature word in the basic dictionary is subjected to part-of-speech expansion to obtain an extended part-of-speech set corresponding to each feature word; each feature word in the basic dictionary is subjected to synonym expansion to obtain a synonym set corresponding to each feature word; each feature word in the basic dictionary is subjected to regular matching to obtain a missing word set corresponding to each feature word; the extended part-of-speech set, synonym set and missing word set corresponding to each feature word are added to the basic dictionary to obtain a feature dictionary.

[0088] In the embodiment of the present invention, part-of-speech expansion may be performed on each feature word in the basic dictionary to obtain an expanded part-of-speech set corresponding to each feature word.

[0089] In an embodiment of the present invention, the verb part of speech in the text can be extracted, and the verb part of speech of each feature word in the basic dictionary can be expanded. The same steps as those for constructing a basic dictionary of preset words can be used to obtain an expanded basic dictionary of verb words.

[0090] In some optional embodiments, the verb parts of speech and noun parts of speech in the text can be extracted separately, and the same steps as those for constructing a basic dictionary of preset words can be used to obtain a basic dictionary of verb words and a basic dictionary of noun words respectively. A certain proportion of the basic dictionary of verb words and the basic dictionary of noun words can be selected (such as selecting the top 50% of feature words respectively) to obtain an extended mixed basic dictionary.

[0091] In some optional embodiments, the verb part of speech and the noun part of speech in the text can be extracted simultaneously to obtain a mixed part of speech, and the same steps as those for constructing a basic dictionary of preset words can be used to obtain an expanded basic dictionary of mixed parts of speech.

[0092] In an embodiment of the present invention, by searching and adding synonyms related to the vocabulary (such as using word vectors and synonym dictionaries to expand the synonyms of feature words), each feature word in the basic dictionary can be synonymously expanded to obtain a set of synonyms corresponding to each feature word, which can increase the vocabulary size and vocabulary richness in the basic dictionary.

[0093] In an embodiment of the present invention, due to the characteristics of the corpus in the financial field, especially the fact that the financial field is in the process of transformation from traditional to Internet, there are many corpus features that are unique to the financial field. Therefore, by summarizing the corpus features, a variety of regular expressions can be obtained. According to the regular expression, each feature word in the basic dictionary can be regularly matched (that is, the missing keywords can be matched), and a set of missing words corresponding to each feature word can be obtained to screen the missing keywords. For example, in an illegal judgment document, there is a relatively standardized expression for illegal regulations, and regular expressions can be used to match special words under the standardized expression (such as illegal issuance of false loans, illegal business operations, and illegal business operations).

[0094] In the embodiment of the present invention, since the problem of feature words being too general and unable to effectively represent the semantic features of the text is unavoidable during the process of automatic feature word extraction, although they are ranked high in the feature dictionary, they cannot effectively represent the semantic features of the text. For example, the word "problem" accounts for a large proportion in the calculation, but because its own use is too general, it cannot effectively display the semantic features of the text. Therefore, during the dictionary construction process, the feature dictionary can be analyzed to see whether it has a high degree of domain specificity and whether it contains enough entries to cover all important concepts and entities in the field. A scoring system can be used to score the feature dictionary, and relevant feature words can be added or deleted to improve the accuracy of the feature dictionary.

[0095] The method for constructing a feature dictionary provided in the embodiment of the present application can extract the word vector of each preset word from the preset text by adopting a preset word vector extraction model, and determine the sentence vector corresponding to each word vector by adopting a preset smooth inverse frequency model, and then calculate the similarity value corresponding to each word vector based on the word vector and the sentence vector corresponding to the word vector. According to the obtained similarity value, the preset words in the preset text can be screened to obtain a feature word set corresponding to the preset text. Afterwards, a feature dictionary in the financial field can be constructed based on the feature word set corresponding to each preset text, which reduces labor costs and realizes automated and efficient construction of a feature dictionary in the financial field, which is helpful for information retrieval and subsequent construction of knowledge graphs for identifying user risks and achieving reliable credit for users.

[0096] Figure 4 is a schematic diagram of an optional process for constructing a feature dictionary according to an embodiment of the present application, such as Figure 4As shown, a large number of financial data sets are first used for pre-training to obtain a FinBERT (preset word vector extraction model) model. Then, the financial field text or document is input into the FinBERT model to use FinBERT for word vector extraction to obtain the word vector of the preset word, and the word vector of the preset word is input into the SIF model to obtain the noun phrase vector of the preset word and the sentence vector corresponding to the word vector of the preset word. The initial similarity between the noun phrase vector of the preset word and the sentence vector corresponding to the word vector of the preset word can be obtained by calculating the cosine similarity. By introducing the position weight in the cosine similarity calculation, the similarity value between the noun phrase vector of the preset word and the sentence vector corresponding to the word vector of the preset word can be determined. According to the similarity value, the feature words can be sorted and extracted to obtain a feature word set. After that, a basic dictionary based on the bag-of-words model and a basic dictionary based on TF-IDF can be constructed to determine the basic dictionary. The part-of-speech expansion, synonym expansion and financial field regular matching expansion can be used to obtain an extended dictionary. Each extended dictionary is added to the basic dictionary, and the basic dictionary is scored using a scoring system to construct a financial field feature dictionary.

[0097] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0098] Example 2

[0099] The present application also provides a device for constructing a feature dictionary. It should be noted that the device for constructing a feature dictionary in the present application can be used to execute the method for constructing a feature dictionary provided in the present application. The following describes the device for constructing a feature dictionary provided in the present application.

[0100] According to an embodiment of the present application, a device for implementing the above-mentioned method for constructing a feature dictionary is also provided. Figure 5 is a schematic diagram of an optional feature dictionary construction device according to an embodiment of the present application, such as Figure 5 As shown, the device for constructing the feature dictionary may include: an extraction unit 50 , a determination unit 51 , a screening unit 52 , and a construction unit 53 .

[0101] The extraction unit 50 is configured to extract a word vector for each preset word from a preset text using a preset word vector extraction model, wherein the preset text is a text pre-annotated with parts of speech, the preset text records financial information in the financial field, and the preset word is a word in the preset text whose part of speech is a noun;

[0102] a determining unit 51 for determining a sentence vector corresponding to each word vector using a preset smoothed inverse frequency model, and determining a similarity value corresponding to each word vector based on the word vector and the sentence vector corresponding to the word vector;

[0103] A screening unit 52 is configured to screen the preset words in the preset text based on the similarity value to obtain a set of feature words corresponding to the preset text;

[0104] The construction unit 53 is configured to construct a feature dictionary in the financial field based on the feature word set corresponding to each preset text.

[0105] The device for constructing a feature dictionary provided in an embodiment of the present application can extract the word vector of each preset word from the preset text by using a preset word vector extraction model through the extraction unit 50, can determine the sentence vector corresponding to each word vector by using a preset smooth inverse frequency model through the determination unit 51, and determine the similarity value corresponding to each word vector based on the word vector and the sentence vector corresponding to the word vector, can filter the preset words in the preset text based on the similarity value through the screening unit 52 to obtain a feature word set corresponding to the preset text, and can construct a feature dictionary in the financial field based on the feature word set corresponding to each preset text through the construction unit 53.

[0106] Optionally, the construction device includes: a first determination module, which is used to use a preset word segmentation model to segment the preset text before using a preset word vector extraction model to extract the word vector of each preset word from the preset text, so as to obtain an initial word set of the preset text, and use a preset part-of-speech tagging model to determine the part of speech of each initial word in the initial word set; a second determination module, which is used to determine the initial word whose part of speech is a noun as a preset word.

[0107] Optionally, the determination unit includes: a third determination module, used to determine the first preset parameter corresponding to each preset word, and determine the first preset smoothing item based on the frequency of occurrence of the preset word in the preset text, the first preset parameter and the word vector; a fourth determination module, used to determine the preset public discourse vector based on the sentence in which the preset word is located, and determine the frequency of occurrence of the preset sentence in the sentence based on the preset public discourse volume; a fifth determination module, used to determine the frequency of occurrence of the preset sentence in the sentence as the second preset smoothing item; a sixth determination module, used to determine the sentence vector corresponding to the word vector based on the first preset smoothing item and the second preset smoothing item.

[0108] Optionally, the determination unit also includes: a seventh determination module, used to determine the first module length of the word vector and determine the second module length of the sentence vector corresponding to the word vector; an eighth determination module, used to determine the initial similarity based on the word vector, the sentence vector corresponding to the word vector, the first module length and the second module length; a first calculation module, used to determine the preset position where the preset word first appears in the preset text, and calculate the position weight of the preset word based on the preset position and the second preset parameter; a ninth determination module, used to determine the similarity value based on the position weight and the initial similarity.

[0109] Optionally, the ninth determination module includes: a first determination submodule, configured to determine a normalized weight of each preset word based on position weights of all preset words; and a second determination submodule, configured to determine a similarity value based on the normalized weight and the initial similarity.

[0110] Optionally, the construction unit includes: a tenth determination module, used to determine the word frequency of each feature word in the feature word set in the preset text for each feature word set; an eleventh determination module, used to determine the sorting order of each feature word based on all word frequencies; a first construction module, used to construct a basic dictionary based on the sorting order of all feature words; a first expansion module, used to expand each feature word in the basic dictionary to obtain a feature dictionary, wherein the feature dictionary is at least used for information retrieval in the financial field.

[0111] Optionally, the first extension module includes: a first extension submodule, used to perform part-of-speech expansion on each feature word in the basic dictionary to obtain an extended part-of-speech set corresponding to each feature word; a second extension submodule, used to perform synonym expansion on each feature word in the basic dictionary to obtain a synonym set corresponding to each feature word; a first matching submodule, used to perform regular matching on each feature word in the basic dictionary to obtain a missing word set corresponding to each feature word; a first processing module, used to add the extended part-of-speech set, synonym set and missing word set corresponding to each feature word to the basic dictionary to obtain a feature dictionary.

[0112] The above-mentioned feature dictionary construction device can also include a processor and a memory. The above-mentioned extraction unit 50, determination unit 51, screening unit 52, construction unit 53, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.

[0113] The processor includes a kernel that retrieves the corresponding program unit from the memory. One or more kernels can be configured, and kernel parameters can be adjusted to construct a feature dictionary for the financial field based on a set of feature words corresponding to each preset text.

[0114] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0115] It should be noted that the extraction unit 50, determination unit 51, screening unit 52, and construction unit 53 correspond to steps S201 to S204 in Example 1. The examples and application scenarios implemented by the above units and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above units can also be part of the device and can be run in the computer terminal 10 provided in Example 1.

[0116] Example 3

[0117] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal or an electronic device.

[0118] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.

[0119] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the method for constructing a feature dictionary: using a preset word vector extraction model to extract the word vector of each preset word from a preset text, wherein the preset text is a text pre-marked with part of speech, the preset text records financial information in the financial field, and the preset word is a word in the preset text whose part of speech is a noun; using a preset smooth inverse frequency model to determine the sentence vector corresponding to each word vector, and based on the word vector and the sentence vector corresponding to the word vector, determining the similarity value corresponding to each word vector; based on the similarity value, screening the preset words in the preset text to obtain a feature word set corresponding to the preset text; constructing a feature dictionary in the financial field based on the feature word set corresponding to each preset text.

[0120] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method of constructing a feature dictionary: using a preset word segmentation model to segment the preset text to obtain an initial word set of the preset text, and using a preset part-of-speech tagging model to determine the part of speech of each initial word in the initial word set; determining the initial word whose part of speech is a noun as a preset word.

[0121] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method of constructing a feature dictionary: determine the first preset parameter corresponding to each preset word, and determine the first preset smoothing item based on the frequency of the preset word appearing in the preset text, the first preset parameter and the word vector; determine the preset common discourse vector based on the sentence in which the preset word is located, and determine the frequency of the preset sentence appearing in the sentence based on the preset common discourse volume; determine the frequency of the preset sentence appearing in the sentence as the second preset smoothing item; determine the sentence vector corresponding to the word vector based on the first preset smoothing item and the second preset smoothing item.

[0122] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method of constructing a feature dictionary: determining the first module length of the word vector, and determining the second module length of the sentence vector corresponding to the word vector; determining the initial similarity based on the word vector, the sentence vector corresponding to the word vector, the first module length and the second module length; determining the preset position where the preset word first appears in the preset text, and calculating the position weight of the preset word based on the preset position and the second preset parameter; determining the similarity value based on the position weight and the initial similarity.

[0123] Optionally, the computer terminal may execute the program code of the following steps in the method for constructing a feature dictionary: determining a normalized weight of each preset word based on the position weights of all preset words; and determining a similarity value based on the normalized weight and the initial similarity.

[0124] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method for constructing a feature dictionary: for each feature word set, determine the word frequency of each feature word in the feature word set in the preset text; based on all word frequencies, determine the sorting order of each feature word; based on the sorting order of all feature words, construct a basic dictionary; expand each feature word in the basic dictionary to obtain a feature dictionary, wherein the feature dictionary is at least used for information retrieval in the financial field.

[0125] Optionally, the above-mentioned computer terminal can execute the program code of the following steps in the method of constructing a feature dictionary: perform part-of-speech expansion on each feature word in the basic dictionary to obtain an extended part-of-speech set corresponding to each feature word; perform synonym expansion on each feature word in the basic dictionary to obtain a synonym set corresponding to each feature word; perform regular matching on each feature word in the basic dictionary to obtain a missing word set corresponding to each feature word; add the extended part-of-speech set, synonym set and missing word set corresponding to each feature word to the basic dictionary to obtain a feature dictionary.

[0126] Optionally, Figure 6 This is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 Only one is shown) processor 602, memory 604, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0127] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method for constructing the feature dictionary and the device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the method for constructing the above-mentioned feature dictionary. The memory may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0128] The processor may call the information and application programs stored in the memory through the transmission device to execute the above steps in the method for constructing the feature dictionary.

[0129] By adopting the embodiment of the present application, a solution for constructing a feature dictionary is provided. By fusing multiple models (such as pre-trained word vector extraction model, sentence vector extraction model, etc.), semantic information is extracted from the preset text, and position weights are introduced to calculate the similarity between word vectors and sentence vectors. According to the similarity, the preset words in the preset text can be screened to obtain a set of feature words corresponding to the preset text. According to the set of feature words corresponding to each preset text, a feature dictionary can be constructed, realizing automated and efficient feature dictionary construction, thereby solving the technical problem of low efficiency in constructing feature dictionaries in related technologies.

[0130] It can be understood by those skilled in the art that Figure 6 The structure shown is for illustration only, and the electronic device may also be a terminal device such as a smart phone, a tablet computer, a PDA, or a mobile Internet device (MID). Figure 6 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 6 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 6 Different configurations shown.

[0131] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0132] Example 4

[0133] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for constructing the feature dictionary provided in the first embodiment.

[0134] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0135] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of the method for constructing a feature dictionary.

[0136] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0137] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0138] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0139] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0140] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0142] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for constructing a feature dictionary, characterized in that: include: A preset word vector extraction model BERT is used to extract a word vector for each preset word from a preset text, wherein the preset text is a text pre-annotated with parts of speech, the preset text records financial information in the financial field, and the preset word is a word in the preset text whose part of speech is a noun; Using a preset smooth inverse frequency model SIF to determine the sentence vector corresponding to each of the word vectors, and determining the similarity value corresponding to each of the word vectors based on the word vectors and the sentence vectors corresponding to the word vectors; Based on the similarity value, the preset words in the preset text are screened to obtain a set of feature words corresponding to the preset text; Constructing a feature dictionary in the financial field based on the feature word set corresponding to each of the preset texts; Among them, the step of using a preset smooth inverse frequency model to determine the sentence vector corresponding to each of the word vectors includes: determining a first preset parameter corresponding to each of the preset words, and determining a first preset smoothing item based on the frequency of occurrence of the preset words in the preset text, the first preset parameter and the word vector; determining a preset common discourse vector based on the sentence in which the preset words are located, and determining the frequency of occurrence of the preset sentence in the sentence based on the preset common discourse volume; determining the frequency of occurrence of the preset sentence in the sentence as a second preset smoothing item; and determining the sentence vector corresponding to the word vector based on the first preset smoothing item and the second preset smoothing item; The step of determining the similarity value corresponding to each word vector based on the word vector and the sentence vector corresponding to the word vector includes: determining a first module length of the word vector and determining a second module length of the sentence vector corresponding to the word vector; determining an initial similarity based on the word vector, the sentence vector corresponding to the word vector, the first module length and the second module length; determining a preset position where the preset word first appears in the preset text, and calculating a position weight of the preset word based on the preset position and a second preset parameter; and determining the similarity value based on the position weight and the initial similarity.

2. The method for constructing a feature dictionary according to claim 1, wherein: Before using the preset word vector extraction model to extract the word vector of each preset word from the preset text, the following steps are included: Segmenting the preset text using a preset word segmentation model to obtain an initial word set of the preset text, and determining the part of speech of each initial word in the initial word set using a preset part of speech tagging model; The initial word whose part of speech is the noun part of speech is determined as the preset word.

3. The method for constructing a feature dictionary according to claim 1, wherein: The step of determining the similarity value based on the position weight and the initial similarity comprises: Determining a normalized weight of each of the preset words based on the position weights of all the preset words; The similarity value is determined based on the normalized weight and the initial similarity.

4. The method for constructing a feature dictionary according to claim 1, wherein: The step of constructing the feature dictionary in the financial field based on the feature word set corresponding to each of the preset texts includes: For each of the feature word sets, determining the frequency of each feature word in the feature word set appearing in the preset text; Based on all the word frequencies, determining the ranking order of each of the feature words; Constructing a basic dictionary based on the sorting order of all the feature words; Each of the feature words in the basic dictionary is expanded to obtain the feature dictionary, wherein the feature dictionary is at least used for information retrieval in the financial field.

5. The method for constructing a feature dictionary according to claim 4, wherein: The step of expanding each of the feature words in the basic dictionary to obtain the feature dictionary includes: Performing part-of-speech expansion on each of the feature words in the basic dictionary to obtain an expanded part-of-speech set corresponding to each of the feature words; Performing synonym expansion on each of the feature words in the basic dictionary to obtain a synonym set corresponding to each of the feature words; Performing regular expression matching on each of the feature words in the basic dictionary to obtain a set of missing words corresponding to each of the feature words; The extended part-of-speech set, the synonym set, and the missing word set corresponding to each feature word are added to the basic dictionary to obtain the feature dictionary.

6. A device for constructing a feature dictionary, executing the method for constructing a feature dictionary according to any one of claims 1 to 5, characterized in that: include: an extraction unit, configured to extract a word vector for each preset word from a preset text using a preset word vector extraction model, wherein the preset text is a text pre-annotated with parts of speech, the preset text records financial information in the financial field, and the preset word is a word in the preset text whose part of speech is a noun; a determining unit, configured to determine a sentence vector corresponding to each of the word vectors using a preset smoothed inverse frequency model, and determine a similarity value corresponding to each of the word vectors based on the word vectors and the sentence vectors corresponding to the word vectors; a screening unit, configured to screen the preset words in the preset text based on the similarity value to obtain a set of feature words corresponding to the preset text; A construction unit is used to construct a feature dictionary in the financial field based on the feature word set corresponding to each preset text.

7. A computer program product, characterized in that The invention comprises a non-volatile computer-readable storage medium storing a computer program, wherein the computer program implements the method for constructing a feature dictionary according to any one of claims 1 to 5 when executed by a processor.

8. An electronic device, characterized in that: The invention comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for constructing a feature dictionary as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Text similarity, acceptation similarity calculating method and system and application system

    CN101079026A

  • Vector database text recall method and device, equipment and medium

    CN118708674A