Content retrieval method and apparatus, electronic device, and storage medium
By splitting search commands into key elements and matching them with the content library during content retrieval, the problems of large annotation workload and inaccurate retrieval in existing technologies are solved, achieving higher retrieval accuracy and more precise content library matching.
Patent Information
- Application Number
- CN202411845704.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2026-06-16
Smart Images

Figure CN122220593A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a content retrieval method, apparatus, device, and storage medium. Background Technology
[0002] Content retrieval refers to the process of retrieving multimedia content based on user input to obtain the content the user needs. Related solutions employ either content aliasing or searching by content name. In the aliasing method, content is manually aliased, and these aliases, along with the content's standard name, are used as the target objects for searching. In the content name search method, the system performs semantic understanding of the user's request, extracts the name of the requested content, and then searches the content library for content with the same or similar names.
[0003] However, using aliases for content annotation is labor-intensive and costly due to the sheer volume of content in the database and the need for annotators to have prior knowledge of these aliases. While machine-based batch annotation of rules can cover some data, omissions are possible due to the diversity of content titles. Furthermore, the variety of expressions makes it difficult to comprehensively cover all possible aliasing styles, leading to gaps in content delivery. Searching by content name is also problematic. For short content names, precise searches are commonly used to find identical results in the database, effectively avoiding similar-sounding results. However, when content names are long, especially in Chinese where errors, omissions, or word order changes occur, precise searches fail to yield accurate results. Using fuzzy matching for similarity matching is problematic because variations in word order in Chinese delivery can lead to no results, and the specific naming conventions of standard content can also result in incorrect search results.
[0004] Therefore, how to further improve the accuracy of content retrieval is an urgent issue to be addressed. Summary of the Invention
[0005] This application provides a content retrieval method, apparatus, device, and storage medium that can improve the accuracy of content retrieval.
[0006] In a first aspect, embodiments of this application provide a content retrieval method, including:
[0007] Retrieve the search command input by the object;
[0008] The first text data is extracted according to the search command, and the first text data includes information about the search content.
[0009] Based on a preset element type, the first text data is split to obtain at least one key element; wherein, the preset element type is obtained according to the naming rules of the content type to which the search content belongs;
[0010] The at least one key element is matched with the name of at least one content in the content library to obtain the target content that matches the search command.
[0011] Secondly, embodiments of this application provide a content retrieval device, including:
[0012] The retrieval unit is used to retrieve the retrieval command input by the object;
[0013] Extraction unit, configured to extract first text data according to the search command, wherein the first text data includes information of the search content;
[0014] A splitting unit is used to split the first text data into at least one key element according to a preset element type; wherein the preset element type is obtained according to the naming rules of the content type to which the search content belongs;
[0015] A matching unit is used to match the name of the at least one key element with the name of at least one content in the content library to obtain target content that matches the search command.
[0016] Thirdly, embodiments of this application provide an electronic device, including:
[0017] A processor and a memory, the memory being used to store a computer program, and the processor being used to invoke and run the computer program stored in the memory to perform the method of the first aspect described above.
[0018] Fourthly, embodiments of this application provide a method for storing a computer program that causes a computer to perform the method described in the first aspect.
[0019] Fifthly, embodiments of this application provide a computer program product, including computer program code, which, when executed by an electronic device, causes the electronic device to perform the method described in the first aspect.
[0020] This application embodiment extracts first text data containing search content information from a search command, and then splits the first text data into at least one key element according to a preset element type. This enables more granular and precise processing of the first text data. Since the preset element type is obtained according to the naming rules of the content type to which the search content belongs, the at least one key element obtained can correspond to the content name respectively. Then, the at least one key element is matched with the name of at least one content in the content library. The search process is not affected by the disorder of the input command sequence and can obtain the target content that matches the search command. This helps to improve the accuracy of content retrieval and the problem of missing content. Attached Figure Description
[0021] Figure 1A This is a schematic diagram illustrating an application scenario according to an embodiment of this application;
[0022] Figure 1B This is a schematic diagram of an interface involved in an embodiment of this application;
[0023] Figure 1C This is a schematic diagram of another interface involved in an embodiment of this application;
[0024] Figure 1D This is a schematic diagram of another interface involved in an embodiment of this application;
[0025] Figure 1E This is a schematic diagram of another interface involved in an embodiment of this application;
[0026] Figure 2 A schematic flowchart illustrating a content retrieval method provided in an embodiment of this application;
[0027] Figure 3 A schematic flowchart illustrating another content retrieval method provided in an embodiment of this application;
[0028] Figure 4 A schematic flowchart illustrating another content retrieval method provided in an embodiment of this application;
[0029] Figure 5 This is a schematic block diagram of a content retrieval device according to an embodiment of this application;
[0030] Figure 6 A schematic block diagram of the electronic device provided in the embodiments of this application;
[0031] Figure 7 This is a schematic block diagram of the terminal provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0033] It should be understood that in the embodiments of this application, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0034] In the description of this application, unless otherwise stated, "at least one" means one or more, and "multiple" means two or more. Additionally, "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0035] It should also be understood that the descriptions of "first", "second", etc. appearing in the embodiments of this application are only for illustration and to distinguish the objects being described, and there is no order to them. They do not indicate any special limitation on the number of devices in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application.
[0036] It should also be understood that specific features, structures, or characteristics relating to embodiments in the specification are included in at least one embodiment of this application. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0037] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products, or devices.
[0038] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0039] First, the relevant terms involved in the embodiments of this application will be described.
[0040] 1. Classical Music: refers to a musical form that developed from the Western musical tradition, typically encompassing musical works from the Middle Ages to the modern era. Classical music is renowned for its complex structure, rich emotional expression, and high technical demands.
[0041] 2. Chinese on-demand: The process by which users issue commands to voice assistants or online services using Chinese as the primary description to search for and play streaming media with specific names or content.
[0042] 3. Exact Search: This refers to a search result where the search terms are exactly the same as the search terms. In search engines, exact search is typically used to find documents or information that perfectly match the user's input keywords. This search method does not require any parsing or splitting of the search content; instead, it directly matches the user's input keywords with data in the database. Because exact search requires a very high degree of matching, the search results usually return only one or a few documents that perfectly match the search terms.
[0043] 4. Fuzzy Search: Allows users to input queries that partially or nearly match records in the database. Even if the query contains spelling errors or incomplete matches, relevant results will still be returned. Fuzzy search can save time and help users find relevant information faster.
[0044] 5. Edit distance (Levenshtein distance): Calculates the minimum number of edit operations (insertion, deletion, replacement) between two strings. It is used to measure the similarity of strings and is a commonly used method in fuzzy search.
[0045] 6. Semantic understanding: This is an important area within Natural Language Processing (NLP), aiming to enable computers to understand and interpret the meaning of human language. Semantic understanding involves multiple levels of analysis, including lexical, syntactic, semantic, and pragmatic aspects.
[0046] 7. Intent Classification: This is an important task in NLP, aiming to identify the intent behind a user's natural language input. For example, determining whether a user's voice command is for requesting music or some other action.
[0047] 8. Slot Extraction: This is an important task in NLP, aiming to extract specific entities or information from a user's natural language input. This information is typically used to complete a specific task or query. For example, extracting the song title and artist name from a user's music request to retrieve corresponding resources from a database.
[0048] In related solutions, content retrieval is performed by adding aliases to the content or by searching by content name. However, the diversity of content names can lead to problems such as no results or inaccurate results in these retrieval algorithms.
[0049] In view of this, embodiments of this application provide a content retrieval method, apparatus, device, and storage medium, which can help improve the accuracy of content retrieval.
[0050] Specifically, the system can obtain the search command input by the user and extract first text data based on the search command. The first text data includes information about the search content. Then, according to a preset element type, the first text data is split to obtain at least one key element. The preset element type is obtained according to the naming rules of the content type to which the search content belongs. The at least one key element is matched with the name of at least one content in the content library to obtain the target content that matches the search command.
[0051] Therefore, this embodiment of the application, after extracting the first text data containing the search content information from the search command, splits the first text data into at least one key element according to a preset element type, thereby achieving more granular and precise processing of the first text data. Since the preset element type is obtained according to the naming rules of the content type to which the search content belongs, the at least one key element obtained based on this can correspond to the content name respectively. Then, the at least one key element is matched with the name of at least one content in the content library. The search process is not affected by the disorder of the input command sequence and can obtain the target content that matches the search command, which helps to improve the accuracy of content retrieval and the problem of missing content.
[0052] On the one hand, when searching by content aliases, this application's embodiments no longer rely on aliases introduced by the diversity of expressions, thus eliminating the need for extensive alias annotation of content data. On the other hand, when searching by content name, this application's embodiments can improve the applicability of precise searches, avoiding situations where precise searches yield no results, while also avoiding retrieval errors caused by using fuzzy searches.
[0053] The content retrieval method provided in this application can be applied to music on-demand application scenarios, such as classical music on-demand application scenarios. Specifically, in scenarios where users express their request for classical music in Chinese, the diversity of Chinese expressions for classical music titles can lead to music retrieval algorithms producing no results or inaccurate results.
[0054] For example, classical music often uses standard naming conventions. Beethoven's Symphony No. 5 in D minor is standardly named such as "Symphony No. 5 in D minor." However, in colloquial expressions, users might use terms like "Symphony No. 5 in D minor," "Symphony No. 5 in D minor," or "Symphony No. 5 in D minor" when requesting music. Since the corresponding musical works are stored in the database using standard naming conventions, inaccurate search results can occur.
[0055] Specifically, when adding aliases to content, classical music pieces are labeled with aliases, including popular names, common expressions, and different word orders that conform to linguistic rules. These are used as search targets along with the standard names of the music pieces. For example, the Symphony No. 5 in D minor can be labeled with aliases such as: Symphony No. 5 in D minor, Fate Symphony, Beethoven's Fifth Symphony, and Symphony No. 5 in D minor. However, the music product database contains over 6 million classical music pieces. Labelers need prior knowledge of the aliases, making the labeling work extremely labor-intensive and costly. If machine batch labeling is used to summarize patterns, the diversity of music piece release names means that only a portion of the data can be covered, resulting in omissions. Furthermore, due to the unique diversity of Chinese expressions, it is difficult to comprehensively cover the rules for summarizing different alias expressions. Therefore, some music pieces are missing when searching for music on demand.
[0056] The content retrieval method provided in this application does not rely on aliases introduced by the diversity of Chinese expressions when searching for music tracks, so there is no need to perform a large number of alias annotations on music data.
[0057] When searching by music title, common music names are usually short, and exact search is often used to find results with the same name in the database, effectively avoiding similar results. However, classical music titles are typically longer, especially in Chinese where errors, omissions, or changes in word order can occur, making exact search inaccurate. Using fuzzy search with similarity matching can lead to problems: firstly, variations in word order in Chinese audio recordings can result in no search results; secondly, the specific naming rules for classical music can introduce incorrect results. For example, using fuzzy search with an edit distance of 1 can result in several possible errors:
[0058] The first scenario: The music library contains Symphony No. 6 in F major. When a user requests "Play Symphony No. 6 in F major" or "Play Symphony No. 6 in F major", the exact search result is no match.
[0059] The second scenario is that when a user requests "Symphony No. 6 in F major", the expected result is a track whose name contains "Symphony No. 6 in F major". However, incorrect results obtained from a fuzzy search may include "Symphony No. 9 in F major", "Symphony No. 6 in F flat major", "Symphony No. 6 in F minor", etc.
[0060] The content retrieval method provided in this application can be applied to classical music on-demand scenarios. Specifically, it can obtain a classical music on-demand command input by an object, and extract first text data based on the classical music command. The first text data includes information about the classical music on-demand. Then, based on a preset element type in the classical music naming, the first text data is split to obtain at least one key element; wherein the preset element type is obtained according to the naming rules of classical music. Then, the at least one key element is matched with the name of at least one classical music in the content library to obtain target content that matches the classical music on-demand command.
[0061] Optionally, the preset element types in classical music naming may include at least one of the following: track type, melody, naming sequence number, chapter, instrument played, and performance style.
[0062] Therefore, this embodiment of the application extracts first text data containing classical music information from a classical music request command, and then splits the first text data into at least one key element according to the preset element type in the classical music name. This enables more granular and precise processing of the first text data. Since the preset element type is obtained according to the naming rules of classical music, the at least one key element obtained can correspond to the classical music name respectively. Then, the at least one key element is matched with at least one classical content name in the content library. The retrieval process is not affected by the disorder of the input command sequence and can obtain the target classical music that matches the classical music request command. This helps to improve the accuracy of classical music request and the problem of missing content.
[0063] On the one hand, when searching by classical music aliases, this application embodiment no longer relies on aliases introduced by the diversity of expressions, thus eliminating the need for extensive alias annotation of classical music data. On the other hand, when searching by classical music names, this application embodiment can improve the applicability of precise searches, avoiding situations where precise searches yield no results, and also avoiding retrieval errors caused by fuzzy searches, enabling the search to find tracks that accurately meet the user's playback expectations.
[0064] Figure 1AThis is a schematic diagram illustrating an application scenario involved in an embodiment of this application. For example... Figure 1A As shown, the application scenario includes a terminal device 102 and a server 104. The terminal device 102 communicates with the server 104 via a network. The server 104 may, but is not limited to, providing services to the terminal device 102 or clients installed on the terminal device 102. Clients may include content playback clients, clients with content playback functionality, such as music apps and video apps; this embodiment does not limit this. The content includes, but is not limited to, music and videos.
[0065] Optional, such as Figure 1A As shown, server 104 can also connect to data storage system 106, such as a database, to provide data storage services for server 104, for example, storing map data. The data storage system can be integrated on server 104 or deployed on the cloud or other servers, without limitation.
[0066] In some possible implementations, terminal device 102 refers to a type of device that has rich human-computer interaction methods, internet access capabilities, typically runs various operating systems, and possesses strong processing capabilities. Terminal device 102 can be a smartphone, tablet computer, laptop computer, desktop computer, wearable device, in-vehicle device, etc., but is not limited to these. Optionally, in this embodiment, wearable device can be a smartwatch, smart bracelet, head-mounted device, etc.
[0067] For example, server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. A server can also be a node in a blockchain. There can be one or more servers. When there are multiple servers, at least two servers are used to provide different services, and / or at least two servers are used to provide the same service, such as providing the same service through load balancing. This embodiment of the application does not limit this.
[0068] The solution provided in this application embodiment can be completed by the terminal device 102 alone, by the server 104 alone, or by the terminal device 102 and the server 104 together.
[0069] It should be understood that Figure 1A This is merely an illustrative example and does not specifically limit the application scenarios of the embodiments of this application.
[0070] In some embodiments, terminal device 102 can send a search command to server 104, which then uses the content retrieval method provided in this application to retrieve target content matching the search command. For example, an object (such as a user) can log in to a client on terminal device 102. In response to the object's input operation, the client obtains the search command input by the object. The client can send the search command to server 104, which extracts first text data based on the search command. The first text data includes information about the search content. Based on a preset element type, the first text data is split into at least one key element, wherein the preset element type is obtained according to the naming rules of the content type to which the search content belongs. The at least one key element is then matched with the name of at least one content in the content library to obtain target content matching the search command. Afterward, server 104 can send the retrieved target content to the client on terminal device 102. Optionally, the client can display and play the target content.
[0071] In some embodiments, the terminal device 102 can locally retrieve target content matching the search command using the content retrieval method provided in this application embodiment. For example, an object (such as a user) can log in to a client on the terminal device 102. In response to the object's input operation, the client obtains the search command input by the object. Further, the client can extract first text data according to the search command. The first text data includes information about the search content. Based on a preset element type, the first text data is split into at least one key element, wherein the preset element type is obtained according to the naming rules of the content type to which the search content belongs. The at least one key element is then matched with the name of at least one content in the content library to obtain target content matching the search command. Optionally, the client can display and play the target content.
[0072] For example, an object (such as a user) can send a request command from the client, such as... Figure 1B As shown, for example, you can input "Play Beethoven's Symphony No. 5 in C minor" via voice. Correspondingly, such as... Figure 1C As shown, the client receives a command and searches for a track. Optionally, the client can send the request command to the server, which then retrieves the target track based on the command and sends it to the client for playback. Alternatively, the client can retrieve the target track locally based on the request command and play it. For example, as... Figure 1DAs shown, the client can add the found Beethoven Symphony No. 5 in C minor to its playlist and play it locally. Optionally, the client can also provide feedback to objects based on the search results. For example, such as... Figure 1E As shown, in response to the play command "Play Beethoven's Symphony No. 5 in C minor", the client can also reply "The following is Beethoven's Symphony No. 5 in C minor. First is the first movement, 'Allegro con brio,' conducted by Wilhelm Furtwangler, followed by the fourth movement, 'Allegro,' performed by the Vienna Philharmonic Orchestra. Get ready to enjoy this classic journey!" Therefore, this embodiment of the application, through semantic understanding of the play command and song retrieval, can return the expected music track to the object for playback.
[0073] The technical solutions of the embodiments of this application will be described in detail below through some examples. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0074] Figure 2 This is a schematic flowchart illustrating a content retrieval method 200 provided in an embodiment of this application. This embodiment can be executed by any electronic device with data processing capabilities, such as a server or terminal device, or jointly by a server and a terminal device. As an example, method 200 can be executed by server 104 in Figure 1, or by terminal device 102 in Figure 1, or jointly by server 104 and terminal device 103. Figure 2 As shown, the method 200 may include steps 210 to 240.
[0075] Step 210: Obtain the search command input by the object.
[0076] For example, an object can input a search command through a client. This search command contains information about the content the object requests, such as the full name of the content, a part of the content name, or the author information, album information, etc., without limitation.
[0077] For example, the content can include various media types, including but not limited to music, video, etc. As a specific example, the music can be classical music.
[0078] The search command can be a voice search command, a text search command, or a text search command converted from voice, etc., without limitation.
[0079] Step 220: Extract the first text data according to the search command. The first text data includes information about the search content.
[0080] For example, slot extraction can be performed on the search command to extract the relevant parts of the search content from the operation command. For instance, the relevant parts of the search content may include the name of the search content.
[0081] Optionally, when the search command is a voice search command, the voice search command can be converted into text to obtain the corresponding text search command. Then, the text search command is extracted to obtain the first text data.
[0082] Step 230: Based on the preset element type, split the first text data to obtain at least one key element; wherein, the preset element type is obtained according to the naming rules of the content type to which the searched content belongs.
[0083] Specifically, based on the preset element content, the first text data can be further subdivided to obtain at least one key element, which can then be used as the key element for the next retrieval step. Since the preset element type is derived from the naming rules of the content type to which the retrieval content belongs, the at least one key element obtained can correspond to a content name; for example, the obtained key element can be a part of the content name.
[0084] For example, classical music has standard naming rules, and its title may include, but is not limited to, at least one of the following: type of music, melody, naming sequence, chapter, instrument played, and performance style.
[0085] In some embodiments, when the content includes classical music, the preset element type includes at least one of the following: track type, melody, naming sequence, chapter, instrument, and performance style.
[0086] As a concrete example, the title of Beethoven's Piano Sonata No. 8 in C minor can be broken down into four parts: key, serial number, instrument, and genre. The key is "C minor", the serial number is "Eighth", the instrument is "piano", and the genre is "sonata".
[0087] In some embodiments, step 230 above can be specifically implemented as splitting the first text data based on a preset template to obtain at least one key element; wherein the preset template includes template data of at least one preset element type.
[0088] In this process, splitting the first text data, i.e., word segmentation, yields at least one of the aforementioned key elements. Word segmentation refers to dividing continuous Chinese text into individual words or phrases, thereby extracting vocabulary from the text for a more accurate understanding of its meaning. In this embodiment, word segmentation of the first text data is performed based on a preset template, i.e., using a predefined grammatical template or structural indication to process the first text data into words. The preset template includes template data of at least one preset element type, including but not limited to grammatical rules, number of fields, and field value composition rules.
[0089] Optionally, for each preset element type in the preset template, a corresponding key element can be extracted.
[0090] One feasible approach is to obtain preset templates—predefined templates for each preset element category—by annotating and mining Chinese data from content samples. Optionally, preset templates can be obtained by analyzing a large amount of sample data. Then, the extracted template data is organized and stored in a knowledge base. During the word segmentation stage, the word segmentation module can read the first text data and segment it using the template data in the knowledge base. During word segmentation, words or phrases can be identified and segmented according to grammatical rules and field value composition rules.
[0091] For example, taking classical music as the content, the template data for each preset element type is shown below:
[0092] Music genres: sonatas, variations, serenades, waltzes, symphonies, etc.
[0093] Melodies: C minor, E major, E major, C sharp minor, etc.;
[0094] Naming sequence: number 1 to 30, etc.;
[0095] Chapters: First Movement, Second Movement, etc.;
[0096] Musical instruments played: piano, violin, flute, saxophone, etc.
[0097] Performance formats: solo, duet, trio, etc.
[0098] Some possible implementations include splitting the first text data (i.e., word segmentation) based on other rules or statistical methods to obtain at least one word, and then matching the at least one word with the prediction template mentioned above to obtain at least one key element.
[0099] In this embodiment, when the content names follow a certain format or rule, high-quality slot extraction can be achieved by splitting the first text data based on a preset template, thus meeting the needs of content retrieval. Furthermore, the template-based matching method is more flexible in iteration and maintenance, allowing for rapid manual intervention in the results.
[0100] In some embodiments, if the word segmentation obtained by splitting the first text data matches the first template data in the preset template and also matches the second template data in the preset template, then the template data containing more characters in the first template data and the second template data is determined as the key element.
[0101] The first and second template data contain template data with more characters, that is, the longest word in the first and second template data. Specifically, for template data with similar expressions in the preset templates, a length-first matching rule can be used to select the longest word matched after segmenting the first text data as the slot extraction result, i.e., the aforementioned key element.
[0102] One possible implementation is to use the longest word matched after segmenting the first text data as the slotting result corresponding to that element type, i.e., the key element, for template data with similar Chinese expressions in the same element type in the preset template.
[0103] As a specific example, the key of the first text data "Piano Sonata No. 14 in C-sharp minor" is "C-sharp minor" instead of "C minor", and the key of the naming sequence is "No. 14" instead of "No. 1".
[0104] Therefore, in this embodiment of the application, when splitting and segmenting words using a preset template, identifying template data containing a large number of characters as key elements can help improve the accuracy of slot extraction and meet the usage requirements of content retrieval.
[0105] As a specific example, when the first text data includes "Piano Sonata No. 8 in C minor", at least one key element extracted is "C minor", "No. 8", "piano", and "sonata". When the first text data includes "Piano Sonata No. 14 in C-sharp minor", at least one key element extracted is "C-sharp minor", "No. 14", "piano", and "sonata".
[0106] In some embodiments, the first text data can be split based on a preset template and preset rules to obtain at least one key element. The preset rules are used to correct the text in the first text data.
[0107] Specifically, since input errors may occur when users enter search commands via keyboard or voice, this will affect the word segmentation process based on the preset template. Therefore, when segmenting the first text data based on the preset template, preset rules can be introduced to correct erroneous text in the first text data, thereby improving the accuracy of extracting key elements.
[0108] Optionally, the preset rules may include at least one of dictionary rules and pinyin matching rules.
[0109] Specifically, dictionary rules define the structure and content of the dictionary, guiding error correction algorithms to identify, match, and correct errors in the input text. For example, a dictionary can include commonly used words, technical terms, place names, personal names, etc., and can also provide clear distinctions and explanations for homophones, synonyms, and antonyms.
[0110] One possible implementation is to utilize vocabulary and rules from a dictionary to detect errors in the initial text data. For example, if a word in the initial text data is not in the dictionary, or its usage does not match the dictionary definition, it can be determined that the word in the initial text data may be incorrect. When an error is detected, a series of possible candidate words can be generated based on the vocabulary and rules in the dictionary. These candidate words are typically similar to the incorrect word in the initial text data in spelling, pronunciation, or semantics. Then, the candidate words can be ranked according to certain rules (such as word frequency, language model, or other rules) to find the most likely correct word. Finally, correction suggestions can be provided based on the ranking results. For example, the suggestions may include one or more possible correct words.
[0111] Pinyin matching rules are primarily used to match the pinyin in the initial input text data with the corresponding Chinese characters, detecting and correcting errors in the text. One possible implementation is to use the converted pinyin to look up corresponding Chinese character combinations in a dictionary. The dictionary typically includes a mapping between pinyin and Chinese characters, as well as common character combinations and word frequency information. Based on the pinyin and dictionary information, a series of possible Chinese character combinations are generated as candidate words. These candidate words are usually similar to or identical in pronunciation to the input pinyin.
[0112] Optionally, at least one of word frequency weighting, context matching, fuzzy matching, and polyphonic character processing can be used to optimize the pinyin matching result. Among them, word frequency weighting refers to using the word frequency information in the dictionary to weight the candidate words. The candidate word with a higher word frequency ranks higher in the matching result. Context matching refers to considering the context information of the input text data to optimize the matching result. For example, if the input pinyin is used as a noun in a sentence, then a noun candidate word is preferred. Fuzzy matching refers to for some inaccurately spelled pinyin inputs, the error correction algorithm may adopt a fuzzy matching strategy to find the most likely correct Chinese character. Polyphonic character processing can provide multiple possible pronunciations and corresponding Chinese character combinations as candidate words for users to use.
[0113] In the scenario of on-demand classical music in Chinese, since many names of classical music are translated from English into Chinese, the same piece may correspond to different translated Chinese names or the pinyin corresponding to the name. Based on this, in the embodiments of this application, these multiple different translated names or the pinyin corresponding to the name can be saved in the dictionary as candidate words to correct the incorrect text in the first text data.
[0114] As a specific example, when the retrieval command is "Play Beethoven's Piano Sonata No. 8 in C minor", in a traditional Chinese system, the input instruction will become "Play Beethoven's 《C Xiao Diao Di Ba Gang Qin Zou Ming Qu》". At this time, an example of the dictionary rule is as follows:
[0115] common_dict = {
[0116] 'Diao': '調',
[0117] 'Eight': '8', '捌',
[0118] }
[0119] After correction by the dictionary rule, the correct input instruction: "Play Beethoven's Piano Sonata No. 8 in C minor" can be obtained, and based on this correct input instruction, splitting and word segmentation are performed according to a preset template to obtain at least one key word segment "C minor", "Eight", "Piano", "Sonata".
[0120] As another specific example, when the retrieval command is "Play Beethoven's Piano Sonata No. 8 in C minor", there may be typos in the speech recognition system, making the input instruction become "Play Beethoven's 《C Xiao Diao Di 8 Gang Qin Zou Ming Qu》". At this time, an example of the pinyin matching rule is as follows:
[0121] hanzi_to_pinyin = {
[0122] 'gangqin': ['钢琴', '刚琴'],
[0123] 'zoumingqu': ['sonata', 'sonata', 'sonata section']
[0124] }
[0125] After correction using the pinyin matching rules, the correct input command "Play Beethoven's Piano Sonata No. 8 in C minor" can be obtained. Based on this correct input command, the words are segmented according to the preset template to obtain at least one key word: "C minor", "No. 8", "piano", and "sonata".
[0126] Therefore, in this embodiment of the application, by splitting the first text data based on a preset template and preset rules, and correcting the errors introduced in the first text data, it is possible to improve the accuracy of slot extraction and meet the usage requirements of content retrieval.
[0127] In other embodiments, large models, such as LLM, can be used to make judgments on the error correction of input command content. This application does not limit this approach.
[0128] Therefore, through the processing described above in the embodiments of this application, the key elements in the first text data can be fully extracted, and errors introduced by non-standard input commands can be corrected to conform to the standard values of the preset template, thereby better utilizing the key elements in the subsequent content retrieval process.
[0129] Optionally, in other embodiments, the first text data can be segmented based on statistics or machine learning to obtain at least one of the aforementioned key elements; this application does not limit this. Optionally, the machine learning process can use a Large Language Model (LLM) model to extract key elements.
[0130] Step 240: Match at least one key element with the name of at least one content in the content library to obtain the target content that matches the search command.
[0131] Specifically, after splitting the first text data containing the information to be searched and extracting at least one key element, the target content matching the search command of the object can be retrieved in the content library using the at least one key element.
[0132] It should be understood that the embodiments of this application do not require prior labeling of the content in the content library. Therefore, template content that matches the search command of the object can be obtained simply by searching and matching the name data of the content.
[0133] In some embodiments, the name of the target content includes at least one of the aforementioned key elements. That is, the name of the target content includes all of the key elements described above. For example, when each of the at least one key element obtained in step 230 matches the name of content in the content library, that content is the target content.
[0134] Therefore, this embodiment of the application, after extracting the first text data containing the search content information from the search command, splits the first text data into at least one key element according to a preset element type, thereby achieving more granular and precise processing of the first text data. Since the preset element type is obtained according to the naming rules of the content type to which the search content belongs, the at least one key element obtained based on this can correspond to the content name respectively. Then, the at least one key element is matched with the name of at least one content in the content library. The search process is not affected by the disorder of the input command sequence and can obtain the target content that matches the search command, which helps to improve the accuracy of content retrieval and the problem of missing content.
[0135] On the one hand, when searching by content aliases, this application's embodiments no longer rely on aliases introduced by the diversity of expressions, thus eliminating the need for extensive alias annotation of content data. On the other hand, when searching by content name, this application's embodiments can improve the applicability of precise searches, avoiding situations where precise searches yield no results, while also avoiding retrieval errors caused by using fuzzy searches.
[0136] Optionally, the name of the target content may also include other text besides the at least one key element, and this application embodiment does not limit this.
[0137] Taking classical music as an example, the title of a musical piece is given by the publisher at the time of publication, and the title includes the standard title of the piece. Optionally, in addition to the standard title, the title of a classical music piece may also include album information or section information, without limitation. For example, the title of a classical music piece could be "Piano Sonata No. 8 in C minor, Op. 13 'Pathétique' - Third Movement Rondo - Allegro" or "Beethoven: Pathétique Sonata No. 8 in C minor, Third Movement," etc.
[0138] The search algorithm searches the music database for differences that contain all key elements. For example, only music tracks whose titles contain all four key elements—"C minor," "Eighth," "Piano," and "Sonata"—will be included in the search results, which is the target content mentioned above.
[0139] It should be understood that the embodiments of this application do not limit the method of matching at least one key element with the name of at least one content in the content library.
[0140] In some embodiments, see Figure 3 Step 240 can be specifically implemented as follows: Steps 241 and 242:
[0141] Step 241 If the first name contains a first key element, then obtain the second text data in the first name according to the position of the first key element in the first name. The second text data includes the first key element and n characters before and / or after the position of the first key element in the first name, where n is a positive integer greater than or equal to 0.
[0142] The content library includes the content corresponding to the first name, and at least one key element includes the first key element.
[0143] Step 242: Match the second text data with a preset template. If the length of the template data matched in the preset template is greater than the first key element, then it is determined that the content corresponding to the first name is not the target content.
[0144] The preset template includes template data of at least one preset element type, as described above.
[0145] Specifically, for at least one key element, the existence of similar names, especially words with similar expressions, can affect the accuracy of the content retrieval results in step 240. For example, if at least one key element extracted in step 230 is "C minor," "Eighth," "piano," or "sonata," the title of the piece, "Piano Sonata No. 80 in C-flat minor," will also be searched because it contains "C minor" and "Eighth." Therefore, such cases can be handled according to steps 241 and 242 above during the retrieval process.
[0146] In step 241, second text data is obtained from the first name based on the position of the first key element within the first name. This second text data includes the first key element and n characters before and / or after its position in the first name. This allows for the selection of n characters before and after the position of the word containing the first key element in the first name, resulting in new text data, i.e., the second text data. Then, in step 242, this second text data is matched against a preset template. If a template data is matched within the preset template and its length is greater than the first key element (i.e., a longer string is matched within the preset template), then the content corresponding to the first name does not match the target content of the search command, i.e., it is a counterexample. In this case, the content corresponding to the first name can be discarded and not included in the final search results.
[0147] For example, assuming n=1, the classical music piece requested by the user through a search command is "Piano Sonata No. 8 in C minor". When searching the music database for pieces containing all four key elements "C minor", "No. 8", "piano", and "sonata", the piece "Piano Sonata No. 80 in C-flat minor" contains all four key elements. Then, in this embodiment, each of the four key element values is matched against a preset template with one character before and after it to form a new string (an example of the second text data). That is, it is matched against the template data under each key element category in the preset template, removing negative examples. For example, "C minor" will form a new string "C-flat minor No.", which is matched against the template of the melody element category. At this point, "C-flat minor" is found, and its length is greater than the target keyword "C minor", indicating that this piece is not the intended piece and needs to be discarded. Similarly, the search is performed on the piece names to match and filter those containing other key element words. Finally, the remaining pieces are all those that meet the user's request expectations.
[0148] In some embodiments, the value of n can be determined based on the element type to which the first key element belongs.
[0149] Specifically, due to the different categories of key elements, different n values can be set for different element categories, such as 0, 1, 2, ... etc., to select the length of the string used for comparison when removing rebates.
[0150] For example, for key element types such as "playing musical instruments" and "musical genre", based on the existing template data in the preset template, there is no need to perform matching of strings with extra length, so n=0, that is, no matching to remove counterexamples is performed.
[0151] For example, for the "melody" key element type, n=1 can be set, that is, only one character is added to each end of the string to form a new string for matching to remove negative examples.
[0152] For example, for the "name sequence number" key element type, n=3 can be set, that is, a new string is formed by adding 3 characters to both ends of the string to remove negative examples.
[0153] Therefore, this embodiment of the application selects n more characters before and after the position of the key element in the content name, and then matches them with the template data of the corresponding key element category in the preset template. If a matching result is found and the string length is longer than the key element, the content name is discarded. This allows for further filtering of the matched content to obtain the target content that matches the search command, thereby further improving the accuracy of content retrieval.
[0154] Figure 4This is a schematic flowchart illustrating a content retrieval method according to an embodiment of this application. It should be understood that... Figure 4 The steps or operations of the content retrieval method are illustrated, but these steps or operations are merely examples, and other operations may be performed in the embodiments of this application. Figure 4 Variations of various operations within it. Furthermore... Figure 4 The various steps in can be followed according to Figure 4 The different orders in which they are presented may be executed, and it is possible that they are not intended to be executed. Figure 4 All operations.
[0155] Step 401, obtain the command.
[0156] For example, an object (such as a user) can log in to a client, such as a music app, and perform content searches within the client, such as requesting classical music. In response to the object's input operation, the terminal device can obtain the retrieval command entered by the object. Optionally, the retrieval command can be keyboard-based text input or voice-based input, without limitation.
[0157] Step 402, Intent Classification.
[0158] Specifically, the intent of the natural language text of the command obtained in step 401 can be identified. For example, it can be determined whether the command entered by the object is for requesting music or some other operation.
[0159] Step 403, on-demand playback.
[0160] Specifically, when the command in step 401 is classified by intent, if the classification result is available for on-demand playback, the next step is to execute step 404; otherwise, step 408 is executed.
[0161] Step 404, slot extraction.
[0162] Specifically, slot extraction involves extracting the name portion of the on-demand content from the command. Specifically, it can extract first text data based on the command, which includes information about the searched content (such as its name). Then, based on a preset element type, the first text data is split to obtain at least one key element; wherein, the preset element type is determined according to the naming rules of the content type to which the searched content belongs.
[0163] Taking classical music as an example, the name of the requested track in the command can be extracted and processed. Then, according to the rules that conform to classical music standards, the track name can be split into more granular parts. At least one key element obtained can be used as the key element for the next track retrieval.
[0164] For details on the slot extraction process, please refer to [link / reference]. Figure 2 or Figure 3Descriptions of steps 220 and 230.
[0165] Step 405, Content Retrieval.
[0166] Specifically, at least one key element obtained in step 404 can be matched with the name of at least one content in the content library to obtain the target content that matches the command in step 401. For example, the key elements obtained by splitting the track name can be used to search for tracks that match the target request in the music library. After completing the above search scheme in the track database, one or more results retrieved are the tracks that meet the request requirements.
[0167] It should be noted that the embodiments of this application do not require prior labeling of the content in the content library, but only perform retrieval and matching based on the content name data, thereby reducing a large amount of labeling costs.
[0168] Specifically, the content retrieval process can be found in [reference]. Figure 2 Step 240 or Figure 3 The relevant descriptions of steps 241 and 242 in the text.
[0169] Step 406: Deduplication and sorting.
[0170] Optionally, the search results in step 405 can be further deduplicated and sorted, keeping only one duplicate content and sorting content with higher similarity to form a playlist.
[0171] Step 407, play.
[0172] Specifically, you can play the content according to the playlist obtained in step 406.
[0173] Step 408, respond to the recipient.
[0174] Therefore, this embodiment of the application, after extracting the first text data containing the search content information from the search command, splits the first text data into at least one key element according to a preset element type, thereby achieving more granular and precise processing of the first text data. Since the preset element type is obtained according to the naming rules of the content type to which the search content belongs, the at least one key element obtained based on this can correspond to the content name respectively. Then, the at least one key element is matched with the name of at least one content in the content library. The search process is not affected by the disorder of the input command sequence and can obtain the target content that matches the search command, which helps to improve the accuracy of content retrieval and the problem of missing content.
[0175] For example, the embodiments of this application can solve the problems of missing tracks and low accuracy when using Chinese to request classical music. The search results are not affected by scrambled sentences or typos in the user's input commands, which can significantly improve the user experience when using the music request function. In the sampled test set, after optimization using the solution provided by the embodiments of this application, the number of tracks retrieved when using Chinese to request classical music significantly exceeded that of the comparison group, as shown in Table 1 below. Furthermore, the accuracy of the first song in the user's request list is significantly higher than that of the comparison group, as shown in Table 2 below.
[0176] Table 1
[0177]
[0178] Of these, 100 records are for more than 100 songs.
[0179] Table 2
[0180] Sampling quantity accuracy This application proposal 50 100% Related solutions 50 68% This application proposal 30 90% Related solutions 30 70%
[0181] The specific embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.
[0182] It should also be understood that, in the various method embodiments of this application, the sequence numbers of the above processes do not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. It should be understood that these sequence numbers can be interchanged where appropriate so that the embodiments of this application described can be implemented in a sequence other than those illustrated or described.
[0183] The method embodiments of this application have been described in detail above. The following description, in conjunction with... Figures 5 to 7 The following describes in detail the device embodiments of this application.
[0184] Figure 5 This is a schematic block diagram of the content retrieval device 10 according to an embodiment of this application. Figure 5 As shown, the device 10 may include: an acquisition unit 11, an extraction unit 12, a splitting unit 13, and a matching unit 14.
[0185] Acquisition unit 11 is used to acquire the retrieval command input by the object;
[0186] Extraction unit 12 is used to extract first text data according to the search command, wherein the first text data includes information of the search content;
[0187] The splitting unit 13 is used to split the first text data into at least one key element according to a preset element type; wherein the preset element type is obtained according to the naming rules of the content type to which the search content belongs;
[0188] The matching unit 14 is used to match the name of the at least one key element with the name of at least one content in the content library to obtain the target content that matches the search command.
[0189] Optionally, in some embodiments, the splitting unit 13 is used to split the first text data into at least one key element according to a preset element type, including:
[0190] The first text data is split based on a preset template to obtain at least one key element; wherein the preset template includes template data of at least one preset element type.
[0191] Optionally, in some embodiments, the splitting unit 13 splits the first text data based on a preset template to obtain the at least one key element, including:
[0192] If the word segmentation obtained by splitting the first text data matches the first template data in the preset template and also matches the second template data in the preset template, then the template data containing more characters in the first template data and the second template data is determined as the key element.
[0193] Optionally, in some embodiments, the splitting unit 13 splits the first text data based on a preset template to obtain the at least one key element, including:
[0194] The first text data is split based on the preset template and preset rules to obtain at least one key element; the preset rules are used to correct the text in the first text data.
[0195] Optionally, in some embodiments, the preset rules include at least one of dictionary rules and pinyin matching rules.
[0196] Optionally, in some embodiments, the matching unit 14 matches the at least one key element with the name of at least one content in the content library to obtain target content that matches the search command, including:
[0197] If the first name contains a first key element, then second text data is obtained in the first name according to the position of the first key element in the first name. The second text data includes the first key element and n characters before and / or after the position, where n is a positive integer greater than or equal to 0. The content library includes the content corresponding to the first name, and the at least one key element includes the first key element.
[0198] The second text data is matched with the preset template. If the length of the template data matched in the preset template is greater than that of the first key element, it is determined that the content corresponding to the first name is not the target content. The preset template includes template data of at least one preset element type.
[0199] Optionally, in some embodiments, the value of n is determined according to the element type to which the first key element belongs.
[0200] Optionally, in some embodiments, the name of the target content includes the at least one key element.
[0201] Optionally, in some embodiments, the content includes classical music, and the preset element type includes at least one of the following: track type, melody, naming sequence, chapter, instrument, and performance style.
[0202] Optionally, in some embodiments, the retrieval command includes a voice command or a text command.
[0203] Therefore, this embodiment of the application, after extracting the first text data containing the search content information from the search command, splits the first text data into at least one key element according to a preset element type, thereby achieving more granular and precise processing of the first text data. Since the preset element type is obtained according to the naming rules of the content type to which the search content belongs, the at least one key element obtained based on this can correspond to the content name respectively. Then, the at least one key element is matched with the name of at least one content in the content library. The search process is not affected by the disorder of the input command sequence and can obtain the target content that matches the search command, which helps to improve the accuracy of content retrieval and the problem of missing content.
[0204] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 5 The device shown can perform Figure 2 or Figure 3 or Figure 4The methods of the embodiments shown, and the foregoing and other operations and / or functions of each module in the apparatus are respectively for implementing the corresponding processes in the above methods, will not be described in detail here for the sake of brevity.
[0205] The apparatus and system of this application embodiments have been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that these functional modules can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the methods disclosed in this application embodiments can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0206] Figure 6 This is a schematic block diagram of the electronic device 30 provided in the embodiments of this application.
[0207] like Figure 6 As shown, the electronic device 30 may include:
[0208] The system includes a memory 31 and a processor 32. The memory 31 stores computer programs and transfers the program code to the processor 32. In other words, the processor 32 can retrieve and run the computer programs from the memory 31 to implement the methods described in the embodiments of this application.
[0209] For example, the processor 32 can be used to execute the above-described method embodiments according to instructions in the computer program. For example, the processor can execute a content retrieval method, including:
[0210] Retrieve the search command input by the object;
[0211] The first text data is extracted according to the search command, and the first text data includes information about the search content.
[0212] Based on a preset element type, the first text data is split to obtain at least one key element; wherein, the preset element type is obtained according to the naming rules of the content type to which the search content belongs;
[0213] The at least one key element is matched with the name of at least one content in the content library to obtain the target content that matches the search command.
[0214] In some embodiments of this application, the processor 32 may include, but is not limited to:
[0215] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0216] In some embodiments of this application, the memory 31 includes, but is not limited to:
[0217] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0218] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 31 and executed by the processor 32 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0219] like Figure 6 As shown, the electronic device 30 may further include:
[0220] Transceiver 33, which can be connected to processor 32 or memory 31.
[0221] The processor 32 can control the transceiver 33 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include antennas, and the number of antennas may be one or more.
[0222] It should be understood that the various components in the electronic device are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0223] Taking electronic devices as terminals as an example, Figure 7 A schematic diagram of the hardware structure of a terminal to implement an embodiment of this application.
[0224] The terminal 40 includes, but is not limited to, at least some of the following components: radio frequency unit 41, network module 42, audio output unit 43, input unit 44, sensor 45, display unit 46, user input unit 47, interface unit 48, memory 49, and processor 40.
[0225] Those skilled in the art will understand that the terminal 40 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 40 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 7 The terminal structure shown does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0226] It should be understood that, in this embodiment, the input unit 44 may include a graphics processing unit (GPU) 441 and a microphone 442. The GPU 441 processes image data of still images or videos obtained by an image acquisition device (such as a camera) in video acquisition mode or image acquisition mode. The display unit 46 may include a display panel 461, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 47 includes a touch panel 471 and at least one of other input devices 472. The touch panel 471 is also called a touch screen. The touch panel 471 may include a touch detection device and a touch controller. Other input devices 472 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0227] In this embodiment, the radio frequency unit 41 receives or transmits data. Typically, the radio frequency unit 41 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc.
[0228] The memory 49 can be used to store software programs or instructions, as well as various data. The memory 49 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, applications or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 49 may include volatile memory or non-volatile memory. The memory 49 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0229] Processor 410 may include one or more processing units; optionally, processor 410 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 410.
[0230] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0231] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.
[0232] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0233] It is understood that specific embodiments of this application may involve user information and other related data. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0234] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0235] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or modules may be electrical, mechanical, or other forms.
[0236] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0237] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A content retrieval method, characterized in that, include: Retrieve the search command input by the object; The first text data is extracted according to the search command, and the first text data includes information about the search content. Based on a preset element type, the first text data is split to obtain at least one key element; wherein, the preset element type is obtained according to the naming rules of the content type to which the search content belongs; The at least one key element is matched with the name of at least one content in the content library to obtain the target content that matches the search command.
2. The method according to claim 1, characterized in that, The step of splitting the first text data into at least one key element according to a preset element type includes: The first text data is split based on a preset template to obtain at least one key element; wherein the preset template includes template data of at least one preset element type.
3. The method according to claim 2, characterized in that, The step of splitting the first text data based on a preset template to obtain at least one key element includes: If the word segmentation obtained by splitting the first text data matches the first template data in the preset template and also matches the second template data in the preset template, then the template data containing more characters in the first template data and the second template data is determined as the key element.
4. The method according to claim 2, characterized in that, The step of splitting the first text data based on a preset template to obtain at least one key element includes: The first text data is split based on the preset template and preset rules to obtain at least one key element; the preset rules are used to correct the text in the first text data.
5. The method according to claim 4, characterized in that, The preset rules include at least one of dictionary rules and pinyin matching rules.
6. The method according to claim 1, characterized in that, The step of matching the at least one key element with the name of at least one content in the content library to obtain the target content that matches the search command includes: If the first name contains a first key element, then second text data is obtained in the first name according to the position of the first key element in the first name. The second text data includes the first key element and n characters before and / or after the position, where n is a positive integer greater than or equal to 0. The content library includes the content corresponding to the first name, and the at least one key element includes the first key element. The second text data is matched with the preset template. If the length of the template data matched in the preset template is greater than that of the first key element, it is determined that the content corresponding to the first name is not the target content. The preset template includes template data of at least one preset element type.
7. The method according to claim 6, characterized in that, The value of n is determined according to the element type to which the first key element belongs.
8. The method according to any one of claims 1-7, characterized in that, The name of the target content includes at least one of the key elements.
9. The method according to any one of claims 1-7, characterized in that, The content includes classical music, and the preset element types include at least one of the following: track type, melody, naming sequence, chapter, instrument, and performance style.
10. The method according to any one of claims 1-7, characterized in that, The search commands include voice commands or text commands.
11. A content retrieval device, characterized in that, include: The retrieval unit is used to retrieve the retrieval command input by the object; Extraction unit, configured to extract first text data according to the search command, wherein the first text data includes information of the search content; A splitting unit is used to split the first text data into at least one key element according to a preset element type; wherein the preset element type is obtained according to the naming rules of the content type to which the search content belongs; A matching unit is used to match the name of the at least one key element with the name of at least one content in the content library to obtain target content that matches the search command.
12. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the method according to any one of claims 1-10.
13. A computer storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1-10.
14. A computer program product, characterized in that, It includes computer program code that, when executed by an electronic device, causes the electronic device to perform the method of any one of claims 1-10.