CN113268615A - Resource label generation method and device, electronic equipment and storage medium - Google Patents

Resource label generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113268615A
CN113268615A CN202110570790.7A CN202110570790A CN113268615A CN 113268615 A CN113268615 A CN 113268615A CN 202110570790 A CN202110570790 A CN 202110570790A CN 113268615 A CN113268615 A CN 113268615A
Authority
CN
China
Prior art keywords
text
resource
word
words
labels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110570790.7A
Other languages
Chinese (zh)
Inventor
李珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202110570790.7A priority Critical patent/CN113268615A/en
Publication of CN113268615A publication Critical patent/CN113268615A/en
Pending legal-status Critical Current

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/38Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/381Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using identifiers, e.g. barcodes, RFIDs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Abstract

The invention relates to a data analysis technology, and discloses a resource label generation method, which comprises the following steps: acquiring resource data, and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text; performing word segmentation on the resource text to obtain text word segmentation; counting the occurrence frequency and the word position of the text segmentation words in the resource text, and extracting text characteristic words of the resource text according to the occurrence frequency and the word position; matching the text characteristic words with preset resource labels to obtain initial resource labels; and obtaining relative words of the initial resource labels, and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels. In addition, the invention also relates to a block chain technology, and the resource data can be stored in the nodes of the block chain. The invention also provides a resource label generating device, electronic equipment and a computer readable storage medium. The invention can solve the problem of low accuracy of the label generated by the resource.

Description

Resource label generation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data analysis technologies, and in particular, to a resource tag generation method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Due to the development of computer science, a large amount of resources are generated in daily life and production, but with the explosive growth of the resources, people need to integrate and label the resources better to realize the management of the resources. The generation of tags for resources becomes an increasingly common resource management method.
In the prior art, most resource label generation methods are resource label methods based on machine learning models, in the method, a large amount of training data needs to be manually marked to realize model training, but manual marking is often different in standard, so that the accuracy of the label generated by the model trained by the marked training data to the resource is lower.
Disclosure of Invention
The invention provides a resource label generation method, a resource label generation device and a computer readable storage medium, and mainly aims to solve the problem of low accuracy of a label generated by a resource.
In order to achieve the above object, a resource tag generation method provided by the present invention includes:
acquiring resource data, and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text;
performing word segmentation on the resource text to obtain text word segmentation;
counting the occurrence frequency and word positions of the text participles in the resource text, and extracting text characteristic words of the resource text according to the occurrence frequency and the word positions;
matching the text characteristic words with preset resource labels to obtain initial resource labels;
and obtaining relative words of the initial resource labels, and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels.
Optionally, the segmenting the resource text to obtain text segments includes:
acquiring a pre-constructed dictionary, wherein the dictionary comprises a plurality of standard entries;
dividing the resource text according to a preset first length to obtain search terms;
and searching the search word in the dictionary, determining the search word as a participle of the resource text when a standard entry which is the same as the search word is searched from the dictionary, returning to the step of text division, and dividing the text according to a preset second length until the number of times of text division reaches a preset number of times to obtain the text participle corresponding to the resource text.
Optionally, the counting the occurrence frequency and the word position of the text segmentation in the resource text includes:
traversing the resource text, and determining the frequency of occurrence of the text participles in the resource text as the occurrence frequency;
the resource text is divided into sentences, and the text sentences are sequenced according to the sequence of the text sentences obtained by the division in the resource text;
and determining word positions of the text word segmentation according to the sorted text sentences.
Optionally, the extracting text feature words of the resource text according to the occurrence frequency and the word position includes:
calculating a first index of the text word segmentation according to the occurrence frequency;
acquiring a weight parameter, and calculating a second index of the text word segmentation according to the word position and the weight parameter;
calculating a characteristic value of the text word segmentation according to the first index and the second index;
and selecting the text participles with the characteristic values larger than a preset characteristic threshold value as the text characteristic words.
Optionally, the matching the text feature word with a preset resource tag to obtain an initial resource tag includes:
acquiring a preset feature word mapping table, wherein the feature word mapping table contains a plurality of text feature words and resource labels having mapping relations with the text feature words;
and retrieving the text characteristic words in the characteristic word preset table, and taking the resource labels corresponding to the searched text characteristic words as the initial resource labels.
Optionally, the matching the text feature word with a preset resource tag to obtain an initial resource tag includes:
performing vector conversion on the text feature words to obtain feature word vectors;
acquiring a label vector of a preset resource label, and calculating a distance value between the feature word vector and the label vector by using a preset distance algorithm;
and selecting the resource label with the distance value smaller than a preset distance threshold value as an initial resource label.
Optionally, the screening the initial resource tag according to the relative word and the text feature word to obtain a standard resource tag includes:
constructing an index of the text feature words;
searching in the text characteristic words according to the relative words and the indexes to obtain the text characteristic words which are the same as the relative words;
and deleting the initial resource label corresponding to the text characteristic word to obtain a standard resource label.
In order to solve the above problem, the present invention further provides a resource tag generating apparatus, including:
the text conversion module is used for acquiring resource data and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text;
the text word segmentation module is used for segmenting the resource text to obtain text word segmentation;
the characteristic word extraction module is used for counting the occurrence frequency and word positions of the text participles in the resource text and extracting text characteristic words of the resource text according to the occurrence frequency and the word positions;
the label matching module is used for matching the text characteristic words with preset resource labels to obtain initial resource labels;
and the label screening module is used for obtaining the relative words of the initial resource labels and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the resource label generation method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, which stores at least one instruction, where the at least one instruction is executed by a processor in an electronic device to implement the resource tag generation method described above.
The embodiment of the invention analyzes the content of the resource text by using the intelligent model, thereby realizing the word segmentation of the resource text and being beneficial to improving the accuracy of the word segmentation of the text; counting the occurrence frequency and word positions of the text participles, and extracting text characteristic words of the resource text according to the occurrence frequency and word positions, so that the text participles are screened, and the text characteristic words with high representativeness to the resource text are obtained, and the accuracy and efficiency of generating the data labels are improved; matching the text characteristic words with preset resource labels through a distance algorithm, so that the accuracy of the matched initial resource labels is improved; and screening the generated initial resource label through the relative words and the text characteristic words so as to reduce errors of the generated initial resource label and improve the accuracy of the generated standard resource label. Therefore, the resource tag generation method, the resource tag generation device, the electronic equipment and the computer readable storage medium provided by the invention can solve the problem of low accuracy of the resource tag generation.
Drawings
Fig. 1 is a schematic flowchart of a resource tag generation method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of extracting text feature words according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of generating an initial resource tag according to an embodiment of the present invention;
fig. 4 is a functional block diagram of a resource tag generation apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the resource tag generation method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a resource label generation method. The executing body of the resource tag generation method includes, but is not limited to, at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the resource tag generation method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of a resource tag generation method according to an embodiment of the present invention. In this embodiment, the resource tag generating method includes:
s1, acquiring resource data, and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text.
In the embodiment of the present invention, the resource data may be a description file containing various resources. For example, a survey report article for the gold market, a poster for a promotional event, a broadcast video of a news event, or a broadcast audio of weather conditions, etc.
In detail, the resource data can be uploaded by a user, or captured from a pre-constructed database or a block chain for storing resource data by using a python statement with a data capture function.
In a practical application scenario of the present invention, there are multiple data types in the resource data, for example, a research report of a golden market in a document form, a poster of a promotional activity in an image form, a broadcast video of a news event in a video form, and a broadcast audio of a weather condition in an audio form, and processing resource data in multiple different forms occupies a large amount of computing resources, resulting in low efficiency of generating resource tags.
For example, for the part in the resource data in the form of a document, NLP (Natural Language Processing) technology can be used for text recognition to obtain a resource text; performing text Recognition on the part in the resource data in the form of an image by adopting an OCR (Optical Character Recognition) technology to obtain a resource text; for the part of the audio form in the resource data, text Recognition can be performed by adopting an ASR (Automatic Speech Recognition) technology to obtain a resource text; and performing text recognition on the video part in the resource data by adopting the combination of the ASR technology and the OCR technology to obtain a resource text.
And S2, performing word segmentation on the resource text to obtain text word segmentation.
In the embodiment of the present invention, the resource text includes a large number of text sentences, and each text sentence includes a large number of contents, which may cause low analysis efficiency if the resource text is directly analyzed. Therefore, word segmentation processing can be carried out on the resource text to obtain text word segmentation, so that the efficiency of subsequently generating the resource label is improved.
In one embodiment of the invention, the resource text can be participled by adopting a technical means based on search word matching to obtain text participles.
For example, a pre-constructed dictionary is obtained, the dictionary comprises a plurality of standard entries, the content of the resource text is divided into a plurality of search words according to different lengths, the search words are searched in the dictionary, and when the standard entries identical to the search words are searched from the dictionary, the search words are determined to be the text participles of the resource text.
In detail, the segmenting the resource text to obtain text segments includes:
acquiring a pre-constructed dictionary, wherein the dictionary comprises a plurality of standard entries;
dividing the resource text according to a preset first length to obtain search terms;
and searching the search word in the dictionary, determining the search word as a participle of the resource text when a standard entry which is the same as the search word is searched from the dictionary, returning to the step of text division, and dividing the text according to a preset second length until the number of times of text division reaches a preset number of times to obtain the text participle corresponding to the resource text.
For example, there is a resource text: the gold price of today rises from five to eight yuan per gram; dividing the resource text according to a first length (2) to obtain seven search terms, namely, the current search term, the gold price, the per search term, the gram five search term, the Yushang search term, the rising search term and the eight Yuan search term, respectively searching each search term in the dictionary to obtain three search terms, namely, the current search term, the gold price and the eight Yuan search term, of the dictionary, and determining the current search term, the gold price and the eight Yuan search term as text participles; and further, returning to the step of text division, performing text division according to a preset second length (3), and searching the search words obtained by text division in the dictionary to obtain text word segmentation until the number of text division reaches the preset number, so as to realize word segmentation of the resource text.
In the embodiment, the resource text is segmented and retrieved according to different lengths, the content of the resource text does not need to be analyzed, and the efficiency of segmenting the resource text is improved.
In another embodiment of the invention, the content of the resource text can be analyzed by adopting an intelligent model with a text word segmentation function, so that the word segmentation of the resource text is realized. The intelligent Model includes, but is not limited to, HMM (Hidden Markov Model), N-gram Model.
For example, the resource text is subjected to syntactic and semantic analysis by using an intelligent model, and is cut based on the analysis result to obtain text participles corresponding to the resource text.
In this embodiment, a preset intelligent model is used to perform syntactic analysis on the resource text, that is, the resource text is input into the intelligent model, a multilayer network structure in the intelligent model is used to perform feature extraction on the content of the resource text, and the features are mapped to a pre-constructed feature space, so as to find out an association relationship between each sentence in the resource text according to the features, and further perform sentence splitting processing on the resource text according to the association relationship, thereby obtaining text clauses.
For example, a text statement a, a text statement B and a text statement C exist in the resource text, and after syntactic analysis is performed on the resource text through the intelligent model, it can be known that the association between the text statement a and the text statement B is low, the association between the text statement a and the text statement C is low, and the association between the text statement B and the text statement C is high, so that when the resource text is subjected to sentence division processing, the text statement a can be separately divided into one text statement, and the text statement B and the text statement C can be divided into the same text statement; sentence division is carried out on the text based on the incidence relation among the sentences, and then the accuracy of the text sentence division is improved.
Furthermore, semantic analysis is performed on the resource text by using a preset intelligent model, which means that semantic analysis is performed on each sentence of the text, and the intelligent model is used for performing operations such as feature extraction and weight classification on the text sentences to obtain the sentence meanings of the text sentences, so that word segmentation is performed on the text sentences according to the sentence meanings.
For example, if the sentence meaning of the text sentence a is "golden buy and sell", the pre-stored word segmentation rule related to the golden buy and sell is obtained to segment the text sentence a, so that the text sentence is prevented from being randomly segmented according to a fixed length, and the word segmentation accuracy is improved.
In the embodiment, the content of the resource text is analyzed by using the intelligent model, so that the word segmentation of the resource text is realized, and the accuracy of the word segmentation of the text is improved.
S3, counting the occurrence frequency and the word position of the text participle in the resource text, and extracting the text characteristic word of the resource text according to the occurrence frequency and the word position.
In the embodiment of the invention, because the resource text has more corresponding text participles, but different text participles have different representativeness to the resource text. Therefore, in order to improve the accuracy of the generated resource labels, the embodiment of the present invention performs feature extraction on the text participles to obtain text feature words with higher representativeness to the resource text in the text participles.
In the embodiment of the present invention, the counting of the occurrence frequency and the word position of the text segmentation in the resource text includes:
traversing the resource text, and determining the frequency of occurrence of the text participles in the resource text as the occurrence frequency;
the resource text is divided into sentences, and the text sentences are sequenced according to the sequence of the text sentences obtained by the division in the resource text;
and determining word positions of the text word segmentation according to the sorted text sentences.
For example, a resource text describing the gold market price in 2020 exists, and the frequency of occurrence of the text participle "gold" is determined to be 3 if the number of occurrences of the text participle "gold" in the resource text is 3 after the resource text is traversed; and if the number of times of the text participle of 'gold price' appearing in the resource text is 2, determining that the frequency of the text participle of 'gold price' appears to be 2.
In detail, the resource text can be divided according to preset division symbols, and the text sentences obtained by the division can be sequenced, wherein the division symbols include but are not limited to ","; ",". "a combination of one or more thereof.
For example, the resource text describing the gold market price in 2020 is: gold in 2020 becomes the key investment target of people, the gold price of gold in the first half of the year is about 5 yuan per gram, and the gold price of gold in the second half of the year is about 8 yuan per gram. The resource text can be divided according to the sentence dividing symbols, and the text clauses are sequenced according to the sequence of each text clause in the resource text to obtain a first text clause: "gold became the key investment target of people in 2020", second text clause: "gold price of gold in the first half year is about 5 yuan per gram" and the third text clause: three text sentences, namely that the gold price of gold in the next half year is about 8 yuan per gram.
The word positions of the text participles can be determined according to the sequenced text sentences, for example, if the text participles 'gold' appear in a first text clause, a second text clause and a third text clause, the word positions of the text participles 'gold' are determined to be 1, 2 and 3; the text participle "gold price" appears in the second text clause and the third text clause, and the word positions of the text participle "gold price" are determined to be 2 and 3.
In one practical application scenario of the invention, when the occurrence frequency of the text participle in the resource text is more, or when the position of the word of the text participle in the resource text is more advanced, the text participle can be named more representative to the text resource. Thus. The text participles can be screened by utilizing the occurrence frequency and the word positions so as to screen out text characteristic words which are more representative of resource texts.
In the embodiment of the present invention, referring to fig. 2, the extracting text feature words of the resource text according to the occurrence frequency and the word position includes:
s21, calculating a first index of the text word segmentation according to the occurrence frequency;
s22, obtaining a weight parameter, and calculating a second index of the text participle according to the word position and the weight parameter;
s23, calculating a feature value of the text participle according to the first index and the second index;
and S24, selecting the text participles with the characteristic values larger than the preset characteristic threshold value as the text characteristic words.
In this embodiment, the first index, the second index, and the feature value may all represent a representative size of a resource text by a text word. For example, the larger the numerical values of the first index, the second index, and the feature value are, the larger the representation of the text segmentation on the resource text is, and the smaller the numerical values of the first index, the second index, and the feature value are, the smaller the representation of the text segmentation on the resource text is.
In detail, the occurrence frequency can be substituted into preset key word algorithms such as TF-IDF, TextRank and the like to calculate a first index of text word segmentation.
Specifically, the weight parameter is used to identify importance weights of text segments at different word positions in the resource text, and the weight parameter may be preset by a user. In general, the more preceding the word position, the larger the weight parameter of the text word segmentation; for example, the word positions of the text participle "gold" are 1, 2 and 3, the weight of the text participle "gold" at word position 1 is 0.8, the weight of the text participle "gold" at word position 2 is 0.7, and the weight of the text participle "gold" at word position 3 is 0.6.
In this embodiment, the calculating the second indicator of the text segmentation according to the word position and the weight parameter includes:
calculating a second index of the text segmentation by using the following index algorithm:
F=α*ρ
wherein, F is the second index, α is the weight parameter of the text participle d, and ρ is the word position of the text participle.
Further, calculation of the feature value of the text participle can be achieved by performing operations such as addition and multiplication on the first index and the second index, and the text participle with the feature value larger than the feature threshold value is determined to be a text feature word.
The method and the device for generating the resource text label have the advantages that the occurrence frequency and the word positions of the text participles are counted, the text characteristic words of the resource text are extracted according to the occurrence frequency and the word positions, the text participles are screened, the text characteristic words with high representativeness to the resource text are obtained, and the accuracy and the efficiency of generating the data label are improved.
And S4, matching the text feature words with a preset resource label to obtain an initial resource label.
In the embodiment of the invention, the text characteristic words can be matched with the preset resource labels in a characteristic word mapping mode so as to obtain the initial resource labels.
In the embodiment of the present invention, the matching the text feature word with a preset resource tag to obtain an initial resource tag includes:
acquiring a preset feature word mapping table, wherein the feature word mapping table contains a plurality of text feature words and resource labels having mapping relations with the text feature words;
and retrieving the text characteristic words in the characteristic word preset table, and taking the resource labels corresponding to the searched text characteristic words as the initial resource labels.
For example, if the feature word mapping table includes four text feature words such as "gold", "gold price", "buy amount", and the resource label corresponding to the four text feature words is "gold", when the text feature word corresponding to the resource text includes at least one of "gold", "gold price", "buy amount", and "buy amount", it is determined that the initial resource label of the resource text is "gold".
The embodiment of the invention matches the text characteristic words with the preset resource labels in a characteristic word mapping mode to obtain the initial resource labels, thereby avoiding analyzing the word senses of the characteristic words and being beneficial to improving the efficiency of generating the initial resource labels.
In another embodiment of the present invention, the text feature words may be matched with the preset resource tags by using a preset distance algorithm to obtain the initial resource tags, where the distance algorithm includes, but is not limited to, a euclidean distance algorithm and a cosine distance algorithm.
In another embodiment of the present invention, as shown in fig. 3, the matching the text feature word with a preset resource tag to obtain an initial resource tag includes:
s31, carrying out vector conversion on the text feature words to obtain feature word vectors;
s32, obtaining a label vector of a preset resource label, and calculating a distance value between the feature word vector and the label vector by using a preset distance algorithm;
and S33, selecting the resource label with the distance value smaller than the preset distance threshold value as an initial resource label.
In detail, the text feature words can be subjected to vector conversion through a word vector model with a word vector conversion function to obtain feature word vectors, and the word vector model comprises a word2vec model, a glove model, a bert model and the like.
In this embodiment, the matching between the text feature word and the preset resource tag is realized by calculating a distance value between the feature word vector and the preset tag vector. For example, a text feature word exists a text feature word "gold price" corresponding to the feature word vector 1, a text feature word "gold buy" corresponding to the feature word vector 2, a text feature word "gold buy" corresponding to the feature word vector 3, a text feature word "gold week" corresponding to the feature word vector 4, a resource tag "gold" corresponding to the tag vector theta, it is found by calculation that the distance value between the feature word vector 1 and the tag vector θ is 80, the distance value between the feature word vector 2 and the tag vector θ is 77, the distance value between the feature word vector 3 and the tag vector θ is 82, the distance value between the feature word vector 4 and the tag vector θ is 43, and when the distance threshold is 50, then, the initial labels corresponding to the text characteristic words "gold price", "buy gold" are determined to be "gold", and the initial labels corresponding to the text characteristic words "gold week" are not "gold".
In the embodiment, the text feature words are matched with the preset resource tags through the distance algorithm, so that the accuracy of the matched initial resource tags is improved.
S5, obtaining the relative words of the initial resource labels, and screening the initial resource labels according to the relative words and the text feature words to obtain standard resource labels.
In one practical application scenario of the present invention, the relative word is a word that is similar to the initial resource label but has a different meaning. For example, if the initial resource label is "gold", the corresponding relative words of the initial resource label may be "gold week", "gold holiday", "gold time section", etc. When a relative word occurs in a text feature word of a resource text, the accuracy of the generated initial resource label is reduced, so that the generated initial resource label can be screened through the relative word and the text feature word, the error of the generated initial resource label is reduced, and the accuracy of the generated standard resource label is improved.
In the embodiment of the invention, the relative word can be preset by a user, or the initial resource label is pushed to the user, and the relative word fed back by the user according to the initial resource label is obtained.
Further, the screening the initial resource tag according to the relative word and the text feature word to obtain a standard resource tag includes:
constructing an index of the text feature words;
searching in the text characteristic words according to the relative words and the indexes to obtain the text characteristic words which are the same as the relative words;
and deleting the initial resource label corresponding to the text characteristic word to obtain a standard resource label.
For example, the presence resource text contains the text feature words "travel plan", "gold week", "holiday time", "travel route"; the initial resource labels corresponding to the resource text are 'gold', 'holiday' and 'travel plan'; wherein, the text feature word of the resource text contains a relative word "gold week" of an initial resource label "gold", the "gold" in the initial resource label of the resource text is deleted to obtain a standard resource label of the resource text: a "vacation" and a "travel plan".
The embodiment of the invention analyzes the content of the resource text by using the intelligent model, thereby realizing the word segmentation of the resource text and being beneficial to improving the accuracy of the word segmentation of the text; counting the occurrence frequency and word positions of the text participles, and extracting text characteristic words of the resource text according to the occurrence frequency and word positions, so that the text participles are screened, and the text characteristic words with high representativeness to the resource text are obtained, and the accuracy and efficiency of generating the data labels are improved; matching the text characteristic words with preset resource labels through a distance algorithm, so that the accuracy of the matched initial resource labels is improved; and screening the generated initial resource label through the relative words and the text characteristic words so as to reduce errors of the generated initial resource label and improve the accuracy of the generated standard resource label. Therefore, the resource label generation method provided by the invention can solve the problem of low accuracy of the label generated by the resource.
Fig. 4 is a functional block diagram of a resource tag generation apparatus according to an embodiment of the present invention.
The resource tag generation apparatus 100 according to the present invention may be installed in an electronic device. According to the realized functions, the resource tag generation apparatus 100 may include a text conversion module 101, a text segmentation module 102, a feature word extraction module 103, a tag matching module 104, and a tag screening module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the text conversion module 101 is configured to obtain resource data, perform text conversion on the resource data according to a data type of the resource data, and obtain a resource text;
the text word segmentation module 102 is configured to perform word segmentation on the resource text to obtain text words;
the feature word extraction module 103 is configured to count occurrence frequencies and word positions of the text segments in the resource text, and extract text feature words of the resource text according to the occurrence frequencies and the word positions;
the tag matching module 104 is configured to match the text feature words with a preset resource tag to obtain an initial resource tag;
the tag screening module 105 is configured to obtain a relative word of the initial resource tag, and screen the initial resource tag according to the relative word and the text feature word to obtain a standard resource tag.
In detail, when the modules in the resource tag generation apparatus 100 according to the embodiment of the present invention are used, the same technical means as the resource tag generation method described in fig. 1 to fig. 3 are adopted, and the same technical effect can be produced, which is not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a resource tag generation method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a resource tag generation program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of a resource tag generation program, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., resource tag generation programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The resource tag generation program stored in the memory 11 of the electronic device 1 is a combination of instructions, which when executed in the processor 10, can implement:
acquiring resource data, and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text;
performing word segmentation on the resource text to obtain text word segmentation;
counting the occurrence frequency and word positions of the text participles in the resource text, and extracting text characteristic words of the resource text according to the occurrence frequency and the word positions;
matching the text characteristic words with preset resource labels to obtain initial resource labels;
and obtaining relative words of the initial resource labels, and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 3, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring resource data, and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text;
performing word segmentation on the resource text to obtain text word segmentation;
counting the occurrence frequency and word positions of the text participles in the resource text, and extracting text characteristic words of the resource text according to the occurrence frequency and the word positions;
matching the text characteristic words with preset resource labels to obtain initial resource labels;
and obtaining relative words of the initial resource labels, and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A resource tag generation method, the method comprising:
acquiring resource data, and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text;
performing word segmentation on the resource text to obtain text word segmentation;
counting the occurrence frequency and word positions of the text participles in the resource text, and extracting text characteristic words of the resource text according to the occurrence frequency and the word positions;
matching the text characteristic words with preset resource labels to obtain initial resource labels;
and obtaining relative words of the initial resource labels, and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels.
2. The method for generating resource labels according to claim 1, wherein the segmenting the resource text to obtain text segments comprises:
acquiring a pre-constructed dictionary, wherein the dictionary comprises a plurality of standard entries;
dividing the resource text according to a preset first length to obtain search terms;
and searching the search word in the dictionary, determining the search word as a participle of the resource text when a standard entry which is the same as the search word is searched from the dictionary, returning to the step of text division, and dividing the text according to a preset second length until the number of times of text division reaches a preset number of times to obtain the text participle corresponding to the resource text.
3. The resource tag generation method of claim 1, wherein the counting the occurrence frequency and word positions of the text participles in the resource text comprises:
traversing the resource text, and determining the frequency of occurrence of the text participles in the resource text as the occurrence frequency;
the resource text is divided into sentences, and the text sentences are sequenced according to the sequence of the text sentences obtained by the division in the resource text;
and determining word positions of the text word segmentation according to the sorted text sentences.
4. The resource tag generation method of claim 1, wherein the extracting text feature words of the resource text according to the occurrence frequency and the word positions comprises:
calculating a first index of the text word segmentation according to the occurrence frequency;
acquiring a weight parameter, and calculating a second index of the text word segmentation according to the word position and the weight parameter;
calculating a characteristic value of the text word segmentation according to the first index and the second index;
and selecting the text participles with the characteristic values larger than a preset characteristic threshold value as the text characteristic words.
5. The resource tag generation method of any one of claims 1 to 4, wherein the matching the text feature word with a preset resource tag to obtain an initial resource tag comprises:
acquiring a preset feature word mapping table, wherein the feature word mapping table contains a plurality of text feature words and resource labels having mapping relations with the text feature words;
and retrieving the text characteristic words in the characteristic word preset table, and taking the resource labels corresponding to the searched text characteristic words as the initial resource labels.
6. The method for generating the resource tag according to claim 5, wherein the step of matching the text feature word with a preset resource tag to obtain an initial resource tag comprises:
performing vector conversion on the text feature words to obtain feature word vectors;
acquiring a label vector of a preset resource label, and calculating a distance value between the feature word vector and the label vector by using a preset distance algorithm;
and selecting the resource label with the distance value smaller than a preset distance threshold value as an initial resource label.
7. The method for generating resource labels according to claim 1, wherein the step of screening the initial resource labels according to the relative words and the text feature words to obtain standard resource labels comprises:
constructing an index of the text feature words;
searching in the text characteristic words according to the relative words and the indexes to obtain the text characteristic words which are the same as the relative words;
and deleting the initial resource label corresponding to the text characteristic word to obtain a standard resource label.
8. An apparatus for resource tag generation, the apparatus comprising:
the text conversion module is used for acquiring resource data and performing text conversion on the resource data according to the data type of the resource data to obtain a resource text;
the text word segmentation module is used for segmenting the resource text to obtain text word segmentation;
the characteristic word extraction module is used for counting the occurrence frequency and word positions of the text participles in the resource text and extracting text characteristic words of the resource text according to the occurrence frequency and the word positions;
the label matching module is used for matching the text characteristic words with preset resource labels to obtain initial resource labels;
and the label screening module is used for obtaining the relative words of the initial resource labels and screening the initial resource labels according to the relative words and the text characteristic words to obtain standard resource labels.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the resource tag generation method of any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the resource tag generation method of any one of claims 1 to 7.
CN202110570790.7A 2021-05-25 2021-05-25 Resource label generation method and device, electronic equipment and storage medium Pending CN113268615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110570790.7A CN113268615A (en) 2021-05-25 2021-05-25 Resource label generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110570790.7A CN113268615A (en) 2021-05-25 2021-05-25 Resource label generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113268615A true CN113268615A (en) 2021-08-17

Family

ID=77232709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110570790.7A Pending CN113268615A (en) 2021-05-25 2021-05-25 Resource label generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113268615A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113706322A (en) * 2021-08-31 2021-11-26 康键信息技术(深圳)有限公司 Service distribution method, device, equipment and storage medium based on data analysis
CN113806492A (en) * 2021-09-30 2021-12-17 中国平安人寿保险股份有限公司 Record generation method, device and equipment based on semantic recognition and storage medium
CN114697286A (en) * 2022-04-18 2022-07-01 上海迎盾科技有限公司 Method and device for processing instant messaging data and computer readable storage medium
CN115795517A (en) * 2023-01-28 2023-03-14 佰聆数据股份有限公司 Asset data storage method and device
CN114697286B (en) * 2022-04-18 2024-04-26 上海迎盾科技有限公司 Instant messaging data processing method and device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009293A (en) * 2017-12-26 2018-05-08 北京百度网讯科技有限公司 Video tab generation method, device, computer equipment and storage medium
CN111274442A (en) * 2020-03-19 2020-06-12 聚好看科技股份有限公司 Method for determining video label, server and storage medium
CN111611436A (en) * 2020-06-24 2020-09-01 腾讯科技(深圳)有限公司 Label data processing method and device and computer readable storage medium
CN112100438A (en) * 2020-09-21 2020-12-18 腾讯科技(深圳)有限公司 Label extraction method and device and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108009293A (en) * 2017-12-26 2018-05-08 北京百度网讯科技有限公司 Video tab generation method, device, computer equipment and storage medium
CN111274442A (en) * 2020-03-19 2020-06-12 聚好看科技股份有限公司 Method for determining video label, server and storage medium
CN111611436A (en) * 2020-06-24 2020-09-01 腾讯科技(深圳)有限公司 Label data processing method and device and computer readable storage medium
CN112100438A (en) * 2020-09-21 2020-12-18 腾讯科技(深圳)有限公司 Label extraction method and device and computer readable storage medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113706322A (en) * 2021-08-31 2021-11-26 康键信息技术(深圳)有限公司 Service distribution method, device, equipment and storage medium based on data analysis
CN113806492A (en) * 2021-09-30 2021-12-17 中国平安人寿保险股份有限公司 Record generation method, device and equipment based on semantic recognition and storage medium
CN113806492B (en) * 2021-09-30 2024-02-06 中国平安人寿保险股份有限公司 Record generation method, device, equipment and storage medium based on semantic recognition
CN114697286A (en) * 2022-04-18 2022-07-01 上海迎盾科技有限公司 Method and device for processing instant messaging data and computer readable storage medium
CN114697286B (en) * 2022-04-18 2024-04-26 上海迎盾科技有限公司 Instant messaging data processing method and device and computer readable storage medium
CN115795517A (en) * 2023-01-28 2023-03-14 佰聆数据股份有限公司 Asset data storage method and device
CN115795517B (en) * 2023-01-28 2023-05-16 佰聆数据股份有限公司 Asset data storage method and device

Similar Documents

Publication Publication Date Title
CN112597312A (en) Text classification method and device, electronic equipment and readable storage medium
CN113268615A (en) Resource label generation method and device, electronic equipment and storage medium
CN113312461A (en) Intelligent question-answering method, device, equipment and medium based on natural language processing
CN112541338A (en) Similar text matching method and device, electronic equipment and computer storage medium
CN112380343A (en) Problem analysis method, problem analysis device, electronic device and storage medium
CN112883190A (en) Text classification method and device, electronic equipment and storage medium
CN113033198B (en) Similar text pushing method and device, electronic equipment and computer storage medium
CN112100384B (en) Data viewpoint extraction method, device, equipment and storage medium
CN112883730B (en) Similar text matching method and device, electronic equipment and storage medium
CN113157927A (en) Text classification method and device, electronic equipment and readable storage medium
CN113051356A (en) Open relationship extraction method and device, electronic equipment and storage medium
CN113378970A (en) Sentence similarity detection method and device, electronic equipment and storage medium
CN113360768A (en) Product recommendation method, device and equipment based on user portrait and storage medium
CN113344125B (en) Long text matching recognition method and device, electronic equipment and storage medium
CN114416939A (en) Intelligent question and answer method, device, equipment and storage medium
CN113869456A (en) Sampling monitoring method and device, electronic equipment and storage medium
CN112579781A (en) Text classification method and device, electronic equipment and medium
CN114842982B (en) Knowledge expression method, device and system for medical information system
CN115525761A (en) Method, device, equipment and storage medium for article keyword screening category
CN114943306A (en) Intention classification method, device, equipment and storage medium
CN112632264A (en) Intelligent question and answer method and device, electronic equipment and storage medium
CN114708073A (en) Intelligent detection method and device for surrounding mark and serial mark, electronic equipment and storage medium
CN113806492A (en) Record generation method, device and equipment based on semantic recognition and storage medium
CN113254814A (en) Network course video labeling method and device, electronic equipment and medium
CN117390173B (en) Massive resume screening method for semantic similarity matching

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination