[go: up one dir, main page]

CN113821633A - Text processing method, device and computer storage medium - Google Patents

Text processing method, device and computer storage medium Download PDF

Info

Publication number
CN113821633A
CN113821633A CN202110812188.XA CN202110812188A CN113821633A CN 113821633 A CN113821633 A CN 113821633A CN 202110812188 A CN202110812188 A CN 202110812188A CN 113821633 A CN113821633 A CN 113821633A
Authority
CN
China
Prior art keywords
category
text
processed
classification
level
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
CN202110812188.XA
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110812188.XA priority Critical patent/CN113821633A/en
Publication of CN113821633A publication Critical patent/CN113821633A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例提出了一种文本处理方法、装置及计算机存储介质,该方法包括:获取待处理文本;调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的,可以提高文本的层次分类的准确度。

Figure 202110812188

The embodiment of the present application proposes a text processing method, device and computer storage medium, the method includes: obtaining text to be processed; calling a first classification network to encode and represent secondary categories, category matching parameters, and the to-be-processed text The semantic coding indicates that processing is performed to obtain the classification information of the secondary category of the text to be processed; based on the classification information of the secondary category and the classification information of the primary category of the text to be processed, determine the The classification result of the processed text, the classification information of the first-level category of the text to be processed is obtained by processing the text to be processed through the second classification network, which can improve the accuracy of the hierarchical classification of the text.

Figure 202110812188

Description

文本处理方法、装置及计算机存储介质Text processing method, device and computer storage medium

技术领域technical field

本申请涉及计算机技术领域,尤其涉及一种文本处理方法、装置及计算机存储介质。The present application relates to the field of computer technology, and in particular, to a text processing method, device, and computer storage medium.

背景技术Background technique

层次分类(Hierarchical Multi-Label Classification,HMC)是自然语言处理领域/计算机视觉中一项重要的多分类任务,其特点在于类目标签具有层级关系,上级类目是下级类目的父级,越往下级其粒度越细,如上级类目为“游戏”,其下级类目为“小游戏”、“手游”、“端游”。Hierarchical Multi-Label Classification (HMC) is an important multi-classification task in the field of natural language processing/computer vision. The granularity of the lower level is finer. For example, the upper-level category is "games", and the lower-level categories are "mini games", "mobile games", and "end games".

目前,通常是将层次分类作为一个基础的多分类任务,即直接预测得到下级类目,通过下级类目来逆推得到上级类目,如预测的下级类目为“小游戏”,则可以得出上级类目为“游戏”,但直接预测下级类目往往面临着训练样本集较少的问题,且由于下级类目的数量过多,往往不能准确地进行分类。At present, hierarchical classification is usually used as a basic multi-classification task, that is, the lower-level category is directly predicted, and the upper-level category is obtained by reverse inference through the lower-level category. The upper-level category is called "game", but direct prediction of the lower-level category often faces the problem of less training sample sets, and because the number of lower-level categories is too large, it is often impossible to classify accurately.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种文本处理方法、装置及计算机存储介质,可以提高层次分类的准确度。Embodiments of the present application provide a text processing method, device, and computer storage medium, which can improve the accuracy of hierarchical classification.

一方面,本申请实施例提供了一种文本处理方法,所述方法包括:On the one hand, an embodiment of the present application provides a text processing method, the method includes:

获取待处理文本;Get the pending text;

调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;Invoking the first classification network to process the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed, to obtain the classification information of the secondary category of the text to be processed;

基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。The classification result of the text to be processed is determined based on the classification information of the secondary category and the classification information of the primary category of the text to be processed, and the classification information of the primary category of the text to be processed is obtained through the first It is obtained by processing the text to be processed by the binary classification network.

一方面,本申请实施例提供了一种文本处理装置,所述装置包括:On the one hand, an embodiment of the present application provides a text processing apparatus, and the apparatus includes:

获取模块,用于获取待处理文本;Get module, used to get the text to be processed;

处理模块,用于调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;a processing module, configured to call the first classification network to process the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed, to obtain the classification information of the secondary category of the text to be processed;

所述处理模块,还用于基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。The processing module is further configured to determine the classification result of the text to be processed based on the classification information of the secondary category and the classification information of the primary category of the text to be processed. The classification information of the category is obtained by processing the text to be processed through the second classification network.

一方面,本申请实施例提供了一种计算机设备,包括:处理器、存储器和通信接口,所述处理器、所述存储器和所述通信接口相互连接,所述处理器,适于执行计算机程序,所述存储器,存储有计算机程序,该计算机程序被所述处理器执行时,实现上述的文本处理方法。In one aspect, an embodiment of the present application provides a computer device, including: a processor, a memory, and a communication interface, wherein the processor, the memory, and the communication interface are connected to each other, and the processor is adapted to execute a computer program , the memory stores a computer program, and when the computer program is executed by the processor, the above-mentioned text processing method is implemented.

一方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,该计算机程序适于由处理器加载并执行上述的文本处理方法。In one aspect, an embodiment of the present application provides a computer storage medium, where a computer program is stored in the computer storage medium, and the computer program is adapted to be loaded by a processor and execute the above text processing method.

一方面,本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机存储介质中。计算机设备的处理器从计算机存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述的文本处理方法。In one aspect, an embodiment of the present application provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer storage medium. The processor of the computer device reads the computer instructions from the computer storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned text processing method.

本申请实施例中,首先调用第二分类网络对待处理文本进行处理得到待处理文本的语义编码表示,以及待处理文本的一级类目的分类信息,然后调用第一分类网络对二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示进行处理,得到待处理文本的二级类目的分类信息,最后基于二级类目的分类信息和待处理文本的一级类目的分类信息可以确定待处理文本的分类结果;该文本处理方法通过二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示可以得到待处理文本与二级类目之间的匹配结果,根据该匹配结果可以准确地得到待处理文本的二级类目,使得可以基于匹配的方式得到文本的二级类目,同时结合待处理文本的一级类目的分类信息,可以提高文本的层次分类的准确度。In the embodiment of the present application, the second classification network is first called to process the text to be processed to obtain the semantic coding representation of the to-be-processed text and the classification information of the first-level category of the to-be-processed text, and then the first classification network is called to classify the second-level category The coding representation, the category matching parameters and the semantic coding representation of the text to be processed are processed to obtain the classification information of the secondary category of the text to be processed, and finally based on the classification information of the secondary category and the primary category of the text to be processed The classification information can determine the classification result of the text to be processed; the text processing method can obtain the matching result between the text to be processed and the secondary category through the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed , according to the matching result, the secondary category of the text to be processed can be accurately obtained, so that the secondary category of the text can be obtained based on the matching method, and combined with the classification information of the primary category of the text to be processed, the text can be improved Accuracy of hierarchical classification.

附图说明Description of drawings

为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.

图1是本申请一个示例性实施例提供的一种计算机设备的架构示意图;FIG. 1 is a schematic diagram of the architecture of a computer device provided by an exemplary embodiment of the present application;

图2是本申请一个示例性实施例提供的一种文本处理方法的流程示意图;2 is a schematic flowchart of a text processing method provided by an exemplary embodiment of the present application;

图3是本申请另一个示例性实施例提供的一种文本处理方法的流程示意图;3 is a schematic flowchart of a text processing method provided by another exemplary embodiment of the present application;

图4是本申请另一个示例性实施例提供的一种文本处理方法的流程示意图;4 is a schematic flowchart of a text processing method provided by another exemplary embodiment of the present application;

图5是本申请另一个示例性实施例提供的一种文本处理方法的流程示意图;5 is a schematic flowchart of a text processing method provided by another exemplary embodiment of the present application;

图6是本申请一个示例性实施例提供的一种文本处理装置的结构示意图;6 is a schematic structural diagram of a text processing apparatus provided by an exemplary embodiment of the present application;

图7是本申请另一个示例性实施例提供的一种计算机设备的结构示意图。FIG. 7 is a schematic structural diagram of a computer device provided by another exemplary embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

需要说明的是,本申请实施例中所涉及到的“第一”、“第二”等描述仅用于描述目的,而不能理解为指示或者暗示其相对重要性或者隐含指明所指示的技术特征的数量。因此,限定有“第一”、“第二”的技术特征可以明示或者隐含的包括至少一个该特征。It should be noted that the descriptions such as "first" and "second" involved in the embodiments of this application are only for description purposes, and should not be understood as indicating or implying their relative importance or implicitly indicating the indicated technology number of features. Therefore, technical features defined with "first" and "second" may expressly or implicitly include at least one of the features.

为了实现提高文本的层次分类的准确度的目的,本申请实施例基于云技术提出了一种文本处理方法。In order to achieve the purpose of improving the accuracy of the hierarchical classification of text, an embodiment of the present application proposes a text processing method based on cloud technology.

人工智能(Artificial Intelligence,AI)技术是一门综合学科,涉及领域广泛,既有硬件层面的技术也有软件层面的技术。人工智能基础技术一般包括如传感器、专用人工智能芯片云计算、云存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。Artificial intelligence (Artificial Intelligence, AI) technology is a comprehensive discipline, involving a wide range of fields, both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, cloud storage, big data processing technology, operation/interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning/deep learning.

自然语言处理(Nature Language processing,NLP)是计算机科学领域与人工智能领域中的一个重要方向。它研究能实现人与计算机之间用自然语言进行有效通信的各种理论和方法。自然语言处理是一门融语言学、计算机科学、数学于一体的科学。因此,这一领域的研究将涉及自然语言,即人们日常使用的语言,所以它与语言学的研究有着密切的联系。自然语言处理技术通常包括文本处理、语义理解、机器翻译、机器人问答、知识图谱等技术。Natural Language Processing (NLP) is an important direction in the field of computer science and artificial intelligence. It studies various theories and methods that can realize effective communication between humans and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, the language that people use on a daily basis, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

机器学习(Machine Learning,ML)是一门多领域交叉学科,涉及概率论、统计学、逼近论、凸分析、算法复杂度理论等多门学科。专门研究计算机怎样模拟或实现人类的学习行为,以获取新的知识或技能,重新组织已有的知识结构使之不断改善自身的性能。机器学习是人工智能的核心,是使计算机具有智能的根本途径,其应用遍及人工智能的各个领域。机器学习和深度学习通常包括人工神经网络、置信网络、强化学习、迁移学习、归纳学习、式教学习等技术。Machine Learning (ML) is a multi-field interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in how computers simulate or realize human learning behaviors to acquire new knowledge or skills, and to reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent, and its applications are in all fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, teaching learning and other technologies.

随着人工智能技术研究和进步,人工智能技术在多个领域展开研究和应用,本申请实施例确定文本的分类结果的过程涉及人工智能的自然语言处理和机器学习等技术,具体通过如下实施例进行说明。With the research and progress of artificial intelligence technology, artificial intelligence technology has been researched and applied in many fields. The process of determining the classification result of the text in the embodiment of the present application involves technologies such as natural language processing and machine learning of artificial intelligence. Specifically, the following embodiments are used. Be explained.

为了更好的理解本申请实施例提供的文本处理方法、装置及计算机存储介质,下面先对本申请实施例适用的文本处理系统的架构进行描述。请参阅图1,图1是本申请一个示例性实施例提供的一种文本处理系统的架构示意图。如图1所示,该文本处理系统具体可以包括终端设备101和服务器102,终端设备101与服务器102之间通过网络连接,比如,通过无线网络连接等。In order to better understand the text processing method, device, and computer storage medium provided by the embodiments of the present application, the following first describes the architecture of the text processing system to which the embodiments of the present application are applicable. Please refer to FIG. 1. FIG. 1 is a schematic structural diagram of a text processing system provided by an exemplary embodiment of the present application. As shown in FIG. 1 , the text processing system may specifically include a terminal device 101 and a server 102, and the terminal device 101 and the server 102 are connected through a network, for example, through a wireless network connection.

终端设备101也称为终端(Terminal)、用户设备(user equipment,UE)、接入终端、用户单元、移动设备、用户终端、无线通信设备、用户代理或用户装置。终端设备可以是智能电视、具有无线通信功能的手持设备(例如智能手机、平板电脑)、计算设备(例如个人电脑(personal computer,PC)、车载设备、可穿戴设备或者其他智能装置等,但并不局限于此。The terminal equipment 101 is also referred to as a terminal (Terminal), user equipment (UE), access terminal, subscriber unit, mobile device, user terminal, wireless communication device, user agent, or user equipment. The terminal device can be a smart TV, a handheld device with wireless communication functions (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC), a vehicle-mounted device, a wearable device, or other smart devices, etc., but Not limited to this.

服务器102可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。The server 102 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for basic cloud computing services such as middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.

如图2所示,图2是本申请一个示例性实施例提供的一种文本处理方法的流程示意图,服务器102可以调用第二分类网络包括的语义编码器对输入的待处理文本进行处理得到待处理文本的语义编码表示,以及利用包括的分类层对待处理文本的语义编码表示进行处理,得到待处理文本的一级类目的分类信息,进一步地,调用第一分类网络对二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示进行处理,得到待处理文本的二级类目的分类信息,基于二级类目的分类信息和待处理文本的一级类目的分类信息得到待处理文本的分类结果,该方法通过二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示可以得到待处理文本与二级类目之间的匹配结果,根据该匹配结果可以准确地得到待处理文本的二级类目,使得可以基于匹配的方式得到文本的二级类目,同时结合待处理文本的一级类目的分类信息,可以提高文本的层次分类的准确度。As shown in FIG. 2, FIG. 2 is a schematic flowchart of a text processing method provided by an exemplary embodiment of the present application. The server 102 may call the semantic encoder included in the second classification network to process the input text to be processed to obtain the text to be processed. Processing the semantic coding representation of the text, and using the included classification layer to process the semantic coding representation of the text to be processed to obtain the classification information of the primary category of the text to be processed, and further, calling the first classification network to encode the secondary category Representation, category matching parameters and semantic coding representation of the text to be processed are processed to obtain the classification information of the secondary category of the text to be processed, based on the classification information of the secondary category and the classification information of the primary category of the text to be processed The classification result of the text to be processed is obtained. The method can obtain the matching result between the text to be processed and the secondary category through the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed. According to the matching result The secondary category of the text to be processed can be accurately obtained, so that the secondary category of the text can be obtained based on the matching method, and the classification information of the primary category of the text to be processed can be combined, and the accuracy of the hierarchical classification of the text can be improved. .

在一个实施例中,服务器102可以将视频标题作为待处理文本,用户可以在安装有视频播放客户端的终端设备101上通过输入视频标题,对视频标题进行层次分类,从而完成视频搜索任务;服务器102也可以将商品标题作为待处理文本,对商品标题进行层次分类,从而完成商品搜索任务,等等。In one embodiment, the server 102 can use the video title as the text to be processed, and the user can perform hierarchical classification on the video title by inputting the video title on the terminal device 101 installed with the video playing client, thereby completing the video search task; the server 102 The product title can also be used as the text to be processed, and the product title can be classified hierarchically, so as to complete the product search task, and so on.

可以理解的是,本申请实施例描述的系统的架构示意图是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It can be understood that the schematic diagram of the architecture of the system described in the embodiments of the present application is to more clearly illustrate the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided by the embodiments of the present application. , with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

下面详细介绍本申请的一种文本处理方法。A text processing method of the present application is described in detail below.

如图3所示,图3是本申请另一个示例性实施例提供的一种文本处理方法的流程示意图,以该方法应用于图1中的服务器102为例进行说明,该方法可包括以下步骤:As shown in FIG. 3, FIG. 3 is a schematic flowchart of a text processing method provided by another exemplary embodiment of the present application. Taking the method applied to the server 102 in FIG. 1 as an example, the method may include the following steps :

S301、获取待处理文本。S301. Acquire the text to be processed.

其中,待处理文本为需要进行分类的文本,可以为视频标题、商品标题,等等。The to-be-processed text is the text to be classified, which may be a video title, a commodity title, and the like.

在一个实施例中,待处理文本可以是长度小于预设字数(例如15个字符或15个汉字)的短文本,当然也可以是长文本,本申请不对待处理文本的长度进行限定。In one embodiment, the text to be processed may be short text with a length less than a preset number of characters (for example, 15 characters or 15 Chinese characters), or may of course be long text. This application does not limit the length of the text to be processed.

S302、调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息。S302: Invoke the first classification network to process the secondary category coding representation, the category matching parameters, and the semantic coding representation of the text to be processed, to obtain classification information of the secondary category of the text to be processed.

由于类目本身也是具有语义信息的,因此本申请利用二级类目的词编码表示(例如词向量)构成二级类目编码表示,利用二级类目编码表示来增强对二级类目的识别能力。Since the category itself also has semantic information, this application uses the word coding representation (such as word vector) of the secondary category to form the secondary category coding representation, and uses the secondary category coding representation to enhance the understanding of the secondary category. Recognition ability.

具体地,二级类目编码表示是由预定义的类目层级结构中多个二级类目的词编码表示(例如词向量)构成的矩阵结构的表示,该预定义的类目层级结构包括两级类目:一级类目和二级类目,其中,二级类目为一级类目的下一层级的类目,如一级类目为“游戏”、“科技”,其二级类目可以为“小游戏”、“手游”、“手机”,其中,假设“小游戏”、“手游”、“手机”分别对应的词编码表示为l1、l2、l3,则二级类目编码表示为[l1,l2,l3]或表示为

Figure BDA0003168771280000061
Specifically, the secondary category coding representation is a representation of a matrix structure composed of word coding representations (such as word vectors) of multiple secondary categories in a predefined category hierarchical structure, where the predefined category hierarchical structure includes Two-level categories: a first-level category and a second-level category, where the second-level category is the next-level category of the first-level category. The categories can be "mini game", "mobile game", "mobile phone", among which, if the word codes corresponding to "mini game", "mobile game" and "mobile phone" are respectively expressed as l1, l2, and l3, then the second level The category code is represented as [l1,l2,l3] or as
Figure BDA0003168771280000061

待处理文本的语义编码表示是利用第二分类网络中的语义编码器(例如CNN(Convolutional Neural Networks,卷积神经网络)、LSTM+(Long Short-Term Memory,长短期记忆)、LSTM+注意力机制(Attention))对待处理文本进行编码处理得到的。The semantic encoding representation of the text to be processed is to use the semantic encoder in the second classification network (such as CNN (Convolutional Neural Networks, convolutional neural network), LSTM+ (Long Short-Term Memory, long short-term memory), LSTM+ attention mechanism ( Attention)) is obtained by encoding the text to be processed.

类目匹配参数是在得到第一分类网络和第二分类网络的过程中,通过对初始化的匹配参数进行调整得到的,该初始化的匹配参数是通过对预定义的矩阵结构中的参数进行初始化得到。The category matching parameters are obtained by adjusting the initialized matching parameters in the process of obtaining the first classification network and the second classification network. The initialized matching parameters are obtained by initializing the parameters in the predefined matrix structure. .

服务器可以利用二级类目编码表示对类目匹配参数以及待处理文本的语义编码表示进行处理获取待处理文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果,该匹配结果可以反映待处理文本属于每个二级类目的概率。服务器可以通过调用第二分类网络对待处理文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果进行处理,从而得到待处理文本的二级类目的分类信息,例如待处理文本与每个二级类目之间的匹配结果为[60,20,10,10],处理方式为softmax(匹配结果),则预测的二级类目的分类信息为[0.6,0.2,0.1,0.1],假设二级类目为“小游戏”、“手游”、“手机”、“拉丁舞”,则预测的二级类目的分类信息表示文本预测为“小游戏”、“手游”、“手机”、“拉丁舞”的概率分别为0.6、0.2、0.1、0.1,此时该第二分类网络包括一个以softmax函数为分类函数的分类层。The server may use the secondary category coding representation to process the category matching parameters and the semantic coding representation of the text to be processed to obtain a matching result between the text to be processed and each secondary category in the predefined category hierarchy structure, The matching result can reflect the probability that the text to be processed belongs to each secondary category. The server can process the matching result between the text to be processed and each secondary category in the above-defined category hierarchy by invoking the second classification network, so as to obtain the classification information of the secondary category of the text to be processed, for example The matching result between the text to be processed and each secondary category is [60, 20, 10, 10], and the processing method is softmax (matching result), then the classification information of the predicted secondary category is [0.6, 0.2 ,0.1,0.1], assuming that the secondary categories are "mini games", "mobile games", "mobile phones", and "Latin dance", the classification information of the predicted secondary categories indicates that the text is predicted to be "mini games", The probabilities of "mobile game", "mobile phone", and "Latin dance" are 0.6, 0.2, 0.1, and 0.1, respectively. At this time, the second classification network includes a classification layer with the softmax function as the classification function.

在本实施例中,服务器通过类目匹配参数对待处理文本的语义编码表示和二级类目编码表示进行处理,使得可以基于匹配的方式获取待处理文本与每个二级类目的匹配结果(类似于匹配分数),并基于匹配结果得到待处理文本的二级类目,可以解决训练样本集过少的问题,也能够提高二级类目分类的准确度。In this embodiment, the server processes the semantic coding representation and the secondary category coding representation of the text to be processed through the category matching parameters, so that the matching result between the text to be processed and each secondary category can be obtained based on the matching method ( Similar to the matching score), and obtain the secondary category of the text to be processed based on the matching result, which can solve the problem of too few training samples and improve the accuracy of secondary category classification.

S303、基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。S303. Determine the classification result of the text to be processed based on the classification information of the secondary category and the classification information of the primary category of the text to be processed, where the classification information of the primary category of the text to be processed is: It is obtained by processing the text to be processed through the second classification network.

待处理文本的一级类目的分类信息是通过将待处理文本输入第二分类网络得到的,该第二分类网络包括语义编码器和分类器,语义编码器用于获取待处理文本的语义编码特征,分类器利用待处理文本的语义编码特征得到待处理文本的一级类目的分类信息。The classification information of the first-level category of the text to be processed is obtained by inputting the text to be processed into a second classification network, the second classification network includes a semantic encoder and a classifier, and the semantic encoder is used to obtain the semantic encoding features of the text to be processed , the classifier uses the semantic coding features of the text to be processed to obtain the classification information of the first-level category of the text to be processed.

服务器可以基于二级类目的分类信息得到待处理文本的二级类目,例如二级类目包括“小游戏”、“手游”、“手机”,二级类目的分类信息为[0.6,0.3,0.1],则待处理文本的二级类目为“小游戏”,同时基于一级类目的分类信息得到待处理文本的一级类目,例如一级类目包括“游戏”、“科技”,一级类目的分类信息为[0.8,0.2],则待处理文本的一级类目为“游戏”,将待处理文本的一级类目和二级类目组合作为待处理文本的分类结果,例如待处理文本的分类结果为“游戏/小游戏”。The server can obtain the secondary category of the text to be processed based on the classification information of the secondary category. For example, the secondary category includes "mini game", "mobile game", and "mobile phone", and the classification information of the secondary category is [0.6 ,0.3,0.1], the secondary category of the text to be processed is "mini games", and the primary category of the text to be processed is obtained based on the classification information of the primary category, for example, the primary category includes "games", "Technology", the classification information of the first-level category is [0.8, 0.2], then the first-level category of the text to be processed is "games", and the combination of the first-level category and the second-level category of the pending text is regarded as the pending text. The classification result of the text, for example, the classification result of the text to be processed is "game/mini game".

本申请实施例中,首先调用第二分类网络对待处理文本进行处理得到待处理文本的语义编码表示,以及待处理文本的一级类目的分类信息,然后调用第一分类网络对二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示进行处理,得到待处理文本的二级类目的分类信息,最后基于二级类目的分类信息和待处理文本的一级类目的分类信息可以确定待处理文本的分类结果;该文本处理方法通过二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示可以得到待处理文本与二级类目之间的匹配结果,根据该匹配结果可以准确地得到待处理文本的二级类目,同时结合待处理文本的一级类目的分类信息,可以提高文本的层次分类的准确度。In the embodiment of the present application, the second classification network is first called to process the text to be processed to obtain the semantic coding representation of the to-be-processed text and the classification information of the first-level category of the to-be-processed text, and then the first classification network is called to classify the second-level category The coding representation, the category matching parameters and the semantic coding representation of the text to be processed are processed to obtain the classification information of the secondary category of the text to be processed, and finally based on the classification information of the secondary category and the primary category of the text to be processed The classification information can determine the classification result of the text to be processed; the text processing method can obtain the matching result between the text to be processed and the secondary category through the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed , according to the matching result, the secondary category of the text to be processed can be accurately obtained, and at the same time, the accuracy of the hierarchical classification of the text can be improved by combining the classification information of the primary category of the text to be processed.

图4是本申请另一个示例性实施例提供的一种文本处理方法的流程示意图,以该方法应用于图1中的服务器102为例进行说明,该方法可包括以下步骤:FIG. 4 is a schematic flowchart of a text processing method provided by another exemplary embodiment of the present application. Taking the method applied to the server 102 in FIG. 1 as an example, the method may include the following steps:

S401、获取训练样本集、二级类目编码表示和初始化的匹配参数。S401. Obtain a training sample set, a secondary category code representation, and an initialized matching parameter.

训练样本集中包括多个文本以及多个文本中每个文本的一级类目标签和二级类目标签,二级类目标签为一级类目标签的下一层级的类目标签,如下述表1所示,为训练样本集的一个具体示例,例如,文本“跳一跳,教你上600分的攻略”的一级类目标签为“游戏”,二级类目标签为“小游戏”。The training sample set includes multiple texts and the first-level category label and the second-level category tag of each text in the multiple texts, and the second-level category tag is the next-level category tag of the first-level category tag, as follows Table 1 shows a specific example of the training sample set. For example, the first-level category object of the text "jump, teach you how to score 600 points" is marked as "game", and the second-level category object is marked as "small game" ".

表1Table 1

Figure BDA0003168771280000091
Figure BDA0003168771280000091

初始化的匹配参数是通过对预定义的矩阵结构中的参数进行初始化得到。The initialized matching parameters are obtained by initializing the parameters in the predefined matrix structure.

在一个实施例中,获取二级类目编码表示,包括以下步骤:In one embodiment, obtaining the secondary category code representation includes the following steps:

(1)根据预定义的类目层级结构确定多个一级类目和多个二级类目。(1) Determine multiple first-level categories and multiple second-level categories according to the predefined category hierarchy structure.

为了实现上层类目对下层类目做约束,本申请预定义了类目层级结构,该预定义的类目层级结构包括两级类目:一级类目和二级类目,其中,二级类目为一级类目的下一层级的类目。例如,预定义的类目层级结构可以定义为:一级类目包括“体育”、“游戏”、“娱乐”,“体育”下的二级类目包括“足球”、“跑步”,“游戏”下的二级类目包括“小游戏”、“手游”,“娱乐”下的二级类目包括“音乐”、“电影”。In order to realize that upper-level categories impose constraints on lower-level categories, the present application predefines a category hierarchy structure, and the predefined category hierarchy structure includes two-level categories: a first-level category and a second-level category, wherein the second-level category A category is a category at the next level of a first-level category. For example, a predefined category hierarchy can be defined as: the first-level category includes "sports", "games", "entertainment", and the second-level categories under "sports" include "football", "running", "games" The secondary categories under "Games" and "Mobile Games", and the secondary categories under "Entertainment" include "Music" and "Movies".

(2)获取多个二级类目中每个二级类目的词编码表示。(2) Obtain word coding representation of each secondary category in multiple secondary categories.

对多个二级类目中每个二级类目进行词编码处理(例如word2vec、one-hot编码等)获取每个二级类目的词编码表示。Perform word encoding processing (such as word2vec, one-hot encoding, etc.) on each of the multiple second-level categories to obtain the word-encoded representation of each second-level category.

(3)根据多个二级类目中每个二级类目的词编码表示确定二级类目编码表示。(3) Determine the coded representation of the secondary category according to the coded representation of each secondary category in the multiple secondary categories.

根据每个二级类目的词编码表示得到二级类目编码表示,例如二级类目分别对应的词编码表示为l1、l2、l3,则二级类目编码表示为[l1,l2,l3]或表示为

Figure BDA0003168771280000092
According to the word coding representation of each secondary category, the secondary category coding representation is obtained. For example, the word coding corresponding to the secondary category is represented as l1, l2, and l3, and the secondary category coding is represented as [l1, l2, l3] or expressed as
Figure BDA0003168771280000092

S402、利用初始化的第一神经网络对所述训练样本集中包括的每个文本进行处理,得到所述每个文本的语义编码表示和预测的一级类目的分类信息。S402. Use the initialized first neural network to process each text included in the training sample set to obtain the semantic coding representation of each text and the classification information of the predicted first-level category.

在一个实施例中,初始化的第一神经网络包括初始化的语义编码器(例如CNN、LSTM+、LSTM+Attention),以及初始化的分类器,该分类器包括一个以softmax函数作为分类函数的分类层。In one embodiment, the initialized first neural network includes an initialized semantic encoder (eg, CNN, LSTM+, LSTM+Attention), and an initialized classifier including a classification layer with a softmax function as the classification function.

服务器将训练样本集中包括的每个文本输入初始化的语义编码器进行编码处理,得到每个文本的语义编码表示,并进一步将每个文本的语义编码表示输入初始化的分类器进行分类处理,得到预测的一级类目的分类信息,例如预测的一级类目的分类信息为[0.8,0.1,0.1],假设一级类目为“游戏”、“科技”、“舞蹈”,则预测的一级类目的分类信息表示文本预测为“游戏”、“科技”、“舞蹈”的概率分别为0.8、0.1、0.1。The server encodes the semantic encoder initialized for each text input included in the training sample set, obtains the semantic encoding representation of each text, and further classifies the input-initialized classifier for the semantic encoding representation of each text to obtain a prediction The classification information of the first-level category of the The classification information of the first-level category indicates that the probabilities of text prediction as "game", "technology", and "dance" are 0.8, 0.1, and 0.1, respectively.

S403、利用初始化的第二神经网络对所述二级类目编码表示、所述初始化的匹配参数以及所述每个文本的语义编码表示进行处理,得到所述每个文本的预测的二级类目的分类信息。S403. Use the initialized second neural network to process the secondary category coding representation, the initialized matching parameters, and the semantic coding representation of each text to obtain the predicted secondary category for each text Purpose classification information.

在一个实施例中,初始化的第二神经网络包括一个以softmax函数作为分类函数的分类层,在利用初始化的第二神经网络包括的分类层对二级类目编码表示、初始化的匹配参数以及每个文本的语义编码表示进行处理,得到每个文本的预测的二级类目的分类信息时,如下述公式(1)所示,服务器可以利用每个文本的语义编码表示乘以初始化的匹配参数乘以二级类目编码表示,获取每个文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果。In one embodiment, the initialized second neural network includes a classification layer that uses a softmax function as a classification function, and encodes representations of secondary categories, initialized matching parameters, and each classification layer using the classification layer included in the initialized second neural network. When processing the semantic coding representation of each text to obtain the classification information of the predicted secondary category of each text, as shown in the following formula (1), the server can use the semantic coding representation of each text to multiply the initialized matching parameters Multiply by the secondary category code representation to obtain the matching result between each text and each secondary category in the above predefined category hierarchy.

Results=L1emb*Wini*fl2_cls (1)Results=L1 emb *W ini *f l2_cls (1)

其中,

Figure BDA0003168771280000101
为匹配结果,
Figure BDA0003168771280000102
为每个文本的语义编码表示,
Figure BDA0003168771280000103
为初始化的匹配参数,
Figure BDA0003168771280000104
为二级类目编码表示,l2_num为二级类目的数量,d×1为二级类目的词编码表示(该词编码表示为词向量)对应的维度,1×e为每个文本的语义编码表示对应的维度。in,
Figure BDA0003168771280000101
For matching results,
Figure BDA0003168771280000102
Semantic encoding representation for each text,
Figure BDA0003168771280000103
is the initialized matching parameter,
Figure BDA0003168771280000104
is the secondary category coding representation, l2_num is the number of secondary categories, d×1 is the dimension corresponding to the secondary category word coding representation (the word coding is represented as a word vector), and 1×e is the size of each text. The semantic encoding represents the corresponding dimension.

可以理解的是,初始化的匹配参数的矩阵结构为e×d,因此需要根据每个文本的语义编码表示对应的维度(1×e),以及二级类目的词编码表示对应的维度(d×1)来确定初始化的匹配参数对应的矩阵大小,又因为初始化的匹配参数是通过对预定义的矩阵结构中的参数进行初始化得到的,因此预定义的矩阵结构的大小是根据每个文本的语义编码表示对应的维度,以及二级类目的词编码表示对应的维度确定的。It can be understood that the matrix structure of the initialized matching parameters is e×d, so the corresponding dimension (1×e) needs to be represented according to the semantic encoding of each text, and the corresponding dimension (d) needs to be represented by the word encoding of the secondary category. ×1) to determine the matrix size corresponding to the initialized matching parameters, and because the initialized matching parameters are obtained by initializing the parameters in the predefined matrix structure, the size of the predefined matrix structure is based on each text. The semantic encoding represents the corresponding dimension, and the word encoding of the secondary category represents that the corresponding dimension is determined.

在一个实施例中,如下述公式(2)所示,服务器还可以利用二级类目编码表示乘以初始化的匹配参数乘以每个文本的语义编码表示,获取每个文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果。In one embodiment, as shown in the following formula (2), the server may also use the secondary category code representation multiplied by the initialized matching parameter multiplied by the semantic code representation of each text to obtain each text and the above-defined predefined Match results between each second-level category in the category hierarchy.

Results=fl2_cls*Wini*L1emb (2)Results=f l2_cls *W ini *L1 emb (2)

其中,

Figure BDA0003168771280000111
为匹配结果,
Figure BDA0003168771280000112
为每个文本的语义编码表示,
Figure BDA0003168771280000113
为初始化的匹配参数,
Figure BDA0003168771280000114
为二级类目编码表示,l2_num为二级类目的数量,1×d为二级类目的词编码表示(该词编码表示为词向量)对应的维度,e×1为每个文本的语义编码表示对应的维度。in,
Figure BDA0003168771280000111
For matching results,
Figure BDA0003168771280000112
Semantic encoding representation for each text,
Figure BDA0003168771280000113
is the initialized matching parameter,
Figure BDA0003168771280000114
is the secondary category coding representation, l2_num is the number of secondary categories, 1×d is the dimension corresponding to the secondary category word coding representation (the word coding is represented as a word vector), and e×1 is the size of each text. The semantic encoding represents the corresponding dimension.

进一步地,服务器利用初始化的第二神经网络包括的分类层对每个文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果进行处理,得到预测的二级类目的分类信息,例如匹配结果为[60,20,10,10],处理方式为softmax(匹配结果),则预测的二级类目的分类信息为[0.6,0.2,0.1,0.1],假设二级类目为“小游戏”、“手游”、“手机”、“拉丁舞”,则预测的二级类目的分类信息表示文本预测为“小游戏”、“手游”、“手机”、“拉丁舞”的概率分别为0.6、0.2、0.1、0.1。Further, the server uses the classification layer included in the initialized second neural network to process the matching result between each text and each secondary category in the above-mentioned predefined category hierarchy to obtain the predicted secondary category. For example, the matching result is [60, 20, 10, 10], and the processing method is softmax (matching result), then the predicted classification information of the secondary category is [0.6, 0.2, 0.1, 0.1], assuming two The first-level categories are "mini games", "mobile games", "mobile phones", and "Latin dance", then the predicted classification information of the second-level categories indicates that the text is predicted to be "mini games", "mobile games", "mobile phones" , and the probabilities of "Latin dance" are 0.6, 0.2, 0.1, and 0.1, respectively.

S404、基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,对所述第一神经网络、所述第二神经网络和所述初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络。S404. Based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label, the first The neural network, the second neural network and the initialized matching parameters are trained to obtain category matching parameters, a first classification network and a second classification network.

服务器可以利用每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、一级类目标签和二级类目标签,对第一神经网络、第二神经网络和初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络。The server can use the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label of each text, to the first neural network, the second neural network and the second-level category label. The initialized matching parameters are trained to obtain category matching parameters, a first classification network and a second classification network.

在一个实施例中,服务器在对第一神经网络、所述第二神经网络和初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络,可以包括以下步骤:In one embodiment, the server is training the first neural network, the second neural network and the initialized matching parameters to obtain the category matching parameters, the first classification network and the second classification network, which may include the following steps:

(1)基于每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、一级类目标签和二级类目标签,确定第一神经网络的第一损失值和第二神经网络的第二损失值。(1) Determine the first loss value of the first neural network based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category tag, and the second-level category tag of each text and the second loss value of the second neural network.

服务器根据每个文本的预测的一级类目的分类信息、一级类目标签以及第一神经网络的第一损失函数,确定第一神经网络的第一损失值。如下述公式(3)所示,其为第一神经网络的第一损失函数,当一级类目为“游戏”、“科技”、“舞蹈”,预测的一级类目的分类信息为[0.8,0.1,0.1],一级类目标签为[1,0,0](表示文本属于“游戏”)时,第一神经网络的第一损失值为-log(0.8)。The server determines the first loss value of the first neural network according to the predicted classification information of the first-level category, the first-level category label, and the first loss function of the first neural network for each text. As shown in the following formula (3), it is the first loss function of the first neural network. When the first-level category is "game", "technology", and "dance", the predicted classification information of the first-level category is [ 0.8, 0.1, 0.1], when the first-level class target label is [1, 0, 0] (indicating that the text belongs to "game"), the first loss value of the first neural network is -log(0.8).

Figure BDA0003168771280000121
Figure BDA0003168771280000121

其中,losscls1为第一神经网络的第一损失函数,yi为一级类目标签,ai为预测的一级类目的分类信息,n为一级类目的数量。Among them, loss cls1 is the first loss function of the first neural network, yi is the first-level category label, a i is the predicted classification information of the first-level category, and n is the number of first-level categories.

进一步地,服务器根据每个文本的预测的二级类目的分类信息、二级类目标签以及第二神经网络的第二损失函数,确定第二神经网络的第二损失值。如下述公式(4)所示,其为第二神经网络的第二损失函数,当二级类目为“小游戏”、“手游”、“手机”、“拉丁舞”,预测的二级类目的分类信息为[0.6,0.2,0.1,0.1],二级类目标签为[1,0,0,0](表示文本属于“小游戏”)时,第二神经网络的第二损失值为-log(0.6)。Further, the server determines the second loss value of the second neural network according to the predicted classification information of the secondary category, the secondary category label and the second loss function of the second neural network for each text. As shown in the following formula (4), it is the second loss function of the second neural network. When the second-level category is "mini game", "mobile game", "mobile phone", "Latin dance", the predicted second-level When the classification information of the category is [0.6, 0.2, 0.1, 0.1], and the secondary category label is [1, 0, 0, 0] (indicating that the text belongs to "mini games"), the second loss of the second neural network The value is -log(0.6).

Figure BDA0003168771280000122
Figure BDA0003168771280000122

其中,losscls2为第二神经网络的第二损失函数,yj为二级类目标签,aj为预测的二级类目的分类信息,m为二级类目的数量。Among them, loss cls2 is the second loss function of the second neural network, y j is the label of the secondary category, a j is the classification information of the predicted secondary category, and m is the number of secondary categories.

(2)根据第一损失值和第二损失值确定总损失值。(2) Determine the total loss value according to the first loss value and the second loss value.

为了保证分类结果的一致性,即保证文本的二级类目与一级类目的一致性(此时二级类目为一级类目的下一层级的类目),本申请在确定总损失值时引入了第三损失值,该第三损失值是通过一级类目与二级类目之间的约束损失函数得到的。In order to ensure the consistency of the classification results, that is, to ensure the consistency between the second-level category and the first-level category of the text (in this case, the second-level category is the category at the next level of the first-level category), this application determines the total The third loss value is introduced in the loss value, and the third loss value is obtained through the constraint loss function between the first-level category and the second-level category.

在一个实施例中,服务器根据第一损失值、第二损失值以及一级类目与二级类目之间的约束损失函数,确定第三损失值。In one embodiment, the server determines the third loss value according to the first loss value, the second loss value, and a constrained loss function between the primary category and the secondary category.

具体地,为了保证分类结果的一致性,又由于一级类目总是易于二级类目的分类,本申请增加一级类目与二级类目之间的一个约束损失函数来保证文本属于一级类目的概率总是要大于属于二级类目的概率,例如文本为一级类目“游戏”的概率为0.8,则为二级类目“小游戏”的概率小于0.8大于或等于0。约束损失函数如下述公式(5)所示:Specifically, in order to ensure the consistency of the classification results, and because the first-level category is always easy to classify the second-level category, this application adds a constraint loss function between the first-level category and the second-level category to ensure that the text belongs to The probability of the first-level category is always greater than the probability of belonging to the second-level category. For example, the probability that the text is the first-level category "game" is 0.8, then the probability of the second-level category "mini game" is less than 0.8 and greater than or equal to 0. The constraint loss function is shown in the following formula (5):

losscls3=max(0,λ+losscls2-losscls1) (5)loss cls3 =max(0,λ+loss cls2 -loss cls1 ) (5)

其中,λ为自定义的参数,用于限定第一损失值和第二损失值的误差范围,losscls3为约束损失函数。Among them, λ is a custom parameter used to limit the error range of the first loss value and the second loss value, and loss cls3 is a constraint loss function.

进一步地,服务器可以根据第一损失函数、第二损失函数和约束损失函数各自的权重系数确定总损失函数,并将第一损失值、第二损失值、第三损失值输入总损失函数得到总损失值。总损失函数如下述公式(6)所示:Further, the server may determine the total loss function according to the respective weight coefficients of the first loss function, the second loss function, and the constraint loss function, and input the first loss value, the second loss value, and the third loss value into the total loss function to obtain the total loss function. loss value. The total loss function is shown in the following formula (6):

Figure BDA0003168771280000131
Figure BDA0003168771280000131

其中,q为训练样本集包括的文本的数量,lossall为总损失函数,λ1、λ2、λ3为第一损失函数、第二损失函数和约束损失函数各自的权重系数,为自定义的参数。Among them, q is the number of texts included in the training sample set, loss all is the total loss function, λ 1 , λ 2 , λ 3 are the respective weight coefficients of the first loss function, the second loss function and the constraint loss function, which are custom parameter.

可以理解的是,当第二损失值大于第一损失值+λ时,文本为一级类目的概率小于二级类目的概率,例如,λ为0,一级类目为“游戏”、“科技”、“舞蹈”,预测的一级类目的分类信息为[0.6,0.2,0.2],一级类目标签为[1,0,0](表示文本属于“游戏”)时,第一损失值为-log(0.6);二级类目为“小游戏”、“手游”、“手机”、“拉丁舞”,预测的二级类目的分类信息为[0.8,0.1,0.1,0],二级类目标签为[1,0,0,0](表示文本属于“小游戏”)时,第二损失值为-log(0.8),此时文本为“游戏”的概率为0.6,为“小游戏”的概率为0.8,此时,第二损失值(-log(0.8))大于第一损失值(-log(0.6)),文本为一级类目(“游戏”)的概率小于二级类目(“小游戏”)的概率,又因为文本属于一级类目的概率总是要大于属于二级类目的概率,因此分类是不准确的,未保证分类结果的一致性,本申请可以通过计算约束损失函数使得此时的第三损失值为正值来增大总损失值,减缓总损失函数的收敛速度来约束分类结果的一致性,也使得后续训练得到的类目匹配参数、第一分类网络和第二分类网络能够对文本实现准确的层次分类。It can be understood that when the second loss value is greater than the first loss value + λ, the probability that the text is a first-level category is less than that of the second-level category. For example, if λ is 0, the first-level category is "game", "Technology", "Dance", when the predicted classification information of the first-level category is [0.6, 0.2, 0.2], and the first-level category tag is [1, 0, 0] (indicating that the text belongs to "game"), the first The first loss value is -log(0.6); the secondary categories are "mini game", "mobile game", "mobile phone", "Latin dance", and the predicted classification information of the secondary category is [0.8, 0.1, 0.1 ,0], when the secondary category target is marked as [1,0,0,0] (indicating that the text belongs to a "mini game"), the second loss value is -log(0.8), and the probability that the text is a "game" at this time is 0.6, and the probability of being a "mini game" is 0.8. At this time, the second loss value (-log(0.8)) is greater than the first loss value (-log(0.6)), and the text is a first-level category ("game" ) is less than the probability of the second-level category (“mini game”), and because the probability that the text belongs to the first-level category is always greater than that of the second-level category, the classification is inaccurate, and the classification results are not guaranteed. The application can increase the total loss value by calculating the constraint loss function so that the third loss value at this time is a positive value, slow down the convergence speed of the total loss function to constrain the consistency of the classification results, and also make the subsequent training get The category matching parameters, the first classification network and the second classification network can achieve accurate hierarchical classification of text.

通过本实施例,在总损失函数中引入约束损失函数,使得总损失值可以约束分类结果的一致性,有效地利用了类目层级结构中上下层约束关系。Through this embodiment, a constraint loss function is introduced into the total loss function, so that the total loss value can constrain the consistency of the classification results, and the upper and lower layer constraints in the category hierarchy structure are effectively utilized.

(3)利用总损失值对第一神经网络的网络参数、第二神经网络的网络参数和初始化的匹配参数进行调整,当总损失值满足收敛条件时,训练得到类目匹配参数、第一分类网络和第二分类网络。(3) Using the total loss value to adjust the network parameters of the first neural network, the network parameters of the second neural network and the initialized matching parameters, when the total loss value satisfies the convergence condition, the training obtains the category matching parameters, the first classification network and a second classification network.

服务器利用总损失值对第一神经网络的网络参数、第二神经网络的网络参数和初始化的匹配参数进行调整,当总损失值满足收敛条件时,或训练次数达到预设值(人为设定)时,则停止对第一神经网络的网络参数、第二神经网络的网络参数和初始化的匹配参数的调整,并根据调整后的初始化的匹配参数得到类目匹配参数,根据调整后的第一神经网络得到第一分类网络,以及根据调整后的第二神经网络得到第二分类网络。The server uses the total loss value to adjust the network parameters of the first neural network, the network parameters of the second neural network, and the initialized matching parameters. When the total loss value satisfies the convergence condition, or the number of training times reaches the preset value (manually set) When , the adjustment of the network parameters of the first neural network, the network parameters of the second neural network and the initialized matching parameters is stopped, and the category matching parameters are obtained according to the adjusted initialized matching parameters. The network obtains the first classification network, and obtains the second classification network according to the adjusted second neural network.

在本申请实施例中,通过对初始化的第一神经网络、初始化的第二神经网络,以及初始化的匹配参数进行训练,得到类目匹配参数,第一分类网络和第二分类网络,可以用于对文本实现准确地层次分类。In the embodiment of the present application, the category matching parameters are obtained by training the initialized first neural network, the initialized second neural network, and the initialized matching parameters. The first classification network and the second classification network can be used for Accurate hierarchical classification of text.

图5是本申请另一个示例性实施例提供的一种文本处理方法的流程示意图,以该方法应用于图1中的服务器102为例进行说明,该方法可包括以下步骤:FIG. 5 is a schematic flowchart of a text processing method provided by another exemplary embodiment of the present application. Taking the method applied to the server 102 in FIG. 1 as an example, the method may include the following steps:

S501、获取待处理文本。S501. Acquire the text to be processed.

S502、调用第二分类网络的语义编码器对所述待处理文本进行处理,得到所述待处理文本的语义编码表示。S502. Invoke the semantic encoder of the second classification network to process the text to be processed to obtain a semantic encoding representation of the text to be processed.

第二分类网络的语义编码器用于获取待处理文本的语义信息,该语义编码器可以为CNN、LSTM、LSTM+Attention,等等。The semantic encoder of the second classification network is used to obtain the semantic information of the text to be processed, and the semantic encoder can be CNN, LSTM, LSTM+Attention, etc.

通过将待处理文本输入第二分类网络的语义编码器可以得到待处理文本的语义编码表示。A semantically encoded representation of the text to be processed can be obtained by inputting the text to be processed into the semantic encoder of the second classification network.

S503、调用所述第二分类网络的分类器对所述待处理文本的语义编码表示进行处理,得到所述待处理文本的一级类目的分类信息。S503. Invoke the classifier of the second classification network to process the semantic coding representation of the text to be processed, and obtain classification information of the first-level category of the text to be processed.

第二分类网络的分类器包括一个以softmax函数作为分类函数的分类层,通过将待处理文本的语义编码表示输入第二分类网络的分类层可以得到待处理文本的一级类目的分类信息,例如一级类目为“游戏”、“科技”、“舞蹈”,一级类目的分类信息为[0.8,0.1,0.1],则一级类目的分类信息表示文本预测为“游戏”、“科技”、“舞蹈”的概率分别为0.8、0.1、0.1。The classifier of the second classification network includes a classification layer with the softmax function as the classification function, and the classification information of the first-level category of the text to be processed can be obtained by inputting the semantic coding representation of the text to be processed into the classification layer of the second classification network, For example, the first-level category is "game", "technology", and "dance", and the classification information of the first-level category is [0.8, 0.1, 0.1], then the classification information of the first-level category indicates that the text is predicted as "game", The probabilities of "technology" and "dance" are 0.8, 0.1, and 0.1, respectively.

S504、利用类目匹配参数对所述二级类目编码表示和所述待处理文本的语义编码表示进行处理,确定所述每个二级类目与所述待处理文本之间的匹配结果。S504. Use category matching parameters to process the secondary category coded representation and the semantic coding representation of the text to be processed, and determine a matching result between each secondary category and the text to be processed.

在一个实施例中,服务器在利用类目匹配参数对二级类目编码表示以及待处理文本的语义编码表示进行处理时,如下述公式(7)所示,服务器可以利用待处理文本的语义编码表示乘以类目匹配参数乘以二级类目编码表示,获取待处理文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果。In one embodiment, when the server uses the category matching parameter to process the secondary category coding representation and the semantic coding representation of the text to be processed, as shown in the following formula (7), the server can use the semantic coding of the text to be processed. The representation is multiplied by the category matching parameter multiplied by the secondary category code representation to obtain the matching result between the text to be processed and each secondary category in the predefined category hierarchy.

Results=L1emb*Wend*fl2_cls (7)Results=L1 emb *W end *f l2_cls (7)

其中,

Figure BDA0003168771280000151
为匹配结果,
Figure BDA0003168771280000152
为待处理文本的语义编码表示,
Figure BDA0003168771280000153
为目录匹配参数,
Figure BDA0003168771280000154
为二级类目编码表示,l2_num为二级类目的数量,d×1为二级类目的词编码表示(该词编码表示为词向量)对应的维度,1×e为待处理文本的语义编码表示对应的维度。in,
Figure BDA0003168771280000151
For matching results,
Figure BDA0003168771280000152
is a semantically encoded representation of the text to be processed,
Figure BDA0003168771280000153
match arguments for directories,
Figure BDA0003168771280000154
is the coding representation of the secondary category, l2_num is the number of secondary categories, d×1 is the dimension corresponding to the word coding representation of the secondary category (the word coding is represented as a word vector), and 1×e is the size of the text to be processed. The semantic encoding represents the corresponding dimension.

在一个实施例中,服务器在利用类目匹配参数对二级类目编码表示以及待处理文本的语义编码表示进行处理时,如下述公式(8)所示,可以利用二级类目编码表示乘以类目匹配参数乘以待处理文本的语义编码表示,获取待处理文本与上述预定义的类目层级结构中每个二级类目之间的匹配结果。In one embodiment, when the server uses the category matching parameter to process the secondary category coding representation and the semantic coding representation of the text to be processed, as shown in the following formula (8), the secondary category coding representation can be used to represent the multiplication The semantic coding representation of the text to be processed is multiplied by the category matching parameter to obtain a matching result between the text to be processed and each second-level category in the above-defined category hierarchy structure.

Results=fl2_cls*Wend*L1emb (8)Results=f l2_cls *W end *L1 emb (8)

其中,

Figure BDA0003168771280000155
为匹配结果,
Figure BDA0003168771280000156
为待处理文本的语义编码表示,
Figure BDA0003168771280000157
为类目匹配参数,
Figure BDA0003168771280000158
为二级类目编码表示,l2_num为二级类目的数量,1×d为二级类目的词编码表示(该词编码表示为词向量)对应的维度,e×1为待处理文本的语义编码表示对应的维度。in,
Figure BDA0003168771280000155
For matching results,
Figure BDA0003168771280000156
is a semantically encoded representation of the text to be processed,
Figure BDA0003168771280000157
match parameters for categories,
Figure BDA0003168771280000158
is the coding representation of the secondary category, l2_num is the number of secondary categories, 1×d is the dimension corresponding to the word coding representation of the secondary category (the word coding is represented as a word vector), and e×1 is the size of the text to be processed. The semantic encoding represents the corresponding dimension.

在本实施例中,服务器通过类目匹配参数对待处理文本的语义编码表示和二级类目编码表示进行处理,使得可以基于匹配的方式获取待处理文本与每个二级类目的匹配结果(类似于匹配分数)。In this embodiment, the server processes the semantic coding representation and the secondary category coding representation of the text to be processed through the category matching parameters, so that the matching result between the text to be processed and each secondary category can be obtained based on the matching method ( similar to match scores).

S505、调用第一分类网络对所述每个二级类目与所述待处理文本之间的匹配结果进行处理,得到所述待处理文本的二级类目的分类信息。S505: Invoke the first classification network to process the matching result between each secondary category and the text to be processed, and obtain the classification information of the secondary category of the text to be processed.

第一分类网络包括一个以softmax函数作为分类函数的分类层,服务器通过将每个二级类目与待处理文本之间的匹配结果输入第一分类网络的分类层得到待处理文本的二级类目的分类信息,例如二级类目为“小游戏”、“手游”、“手机”、“拉丁舞”,二级类目的分类信息为[0.6,0.2,0.1,0.1],则二级类目的分类信息表示文本预测为“小游戏”、“手游”、“手机”、“拉丁舞”的概率分别为0.6、0.2、0.1、0.1。本实施例中,服务器利用第一分类网络对匹配结果进行处理(第一分类网络主要是为了用于进行归一化处理),能够得到待处理文本的二级类目的分类信息,可以解决训练样本集过少的问题,也能够提高二级类目分类的准确度。The first classification network includes a classification layer with the softmax function as the classification function, and the server obtains the second class of the text to be processed by inputting the matching result between each secondary category and the text to be processed into the classification layer of the first classification network. Purpose classification information, for example, the secondary category is "mini game", "mobile game", "mobile phone", "Latin dance", and the classification information of the secondary category is [0.6, 0.2, 0.1, 0.1], then the second The classification information of the first-level category indicates that the probabilities that the text is predicted to be "mini game", "mobile game", "mobile phone", and "Latin dance" are 0.6, 0.2, 0.1, and 0.1, respectively. In this embodiment, the server uses the first classification network to process the matching results (the first classification network is mainly used for normalization processing), and can obtain the classification information of the secondary category of the text to be processed, which can solve the problem of training The problem of too few sample sets can also improve the accuracy of secondary category classification.

S506、基于所述待处理文本的二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果。S506. Determine the classification result of the text to be processed based on the classification information of the secondary category of the text to be processed and the classification information of the primary category of the text to be processed.

服务器基于二级类目的分类信息得到待处理文本的二级类目,基于一级类目的分类信息得到待处理文本的一级类目,将待处理文本的一级类目和二级类目组合作为待处理文本的分类结果。The server obtains the secondary category of the text to be processed based on the classification information of the secondary category, obtains the primary category of the text to be processed based on the classification information of the primary category, and combines the primary category and secondary category of the text to be processed. The item combination is used as the classification result of the text to be processed.

本申请实施例中,首先调用第二分类网络对待处理文本进行处理得到待处理文本的语义编码表示,以及待处理文本的一级类目的分类信息,然后类目匹配参数对二级类目编码表示和待处理文本的语义编码表示进行处理,得到每个二级类目与待处理文本之间的匹配结果,调用第一分类网络对该匹配结果进行处理可以得到待处理文本的二级类目的分类信息,最后基于二级类目的分类信息和待处理文本的一级类目的分类信息可以确定待处理文本的分类结果;该文本处理方法通过类目匹配参数对二级类目编码表示和待处理文本的语义编码表示进行处理可以得到待处理文本与二级类目之间的匹配结果,根据该匹配结果可以准确地得到待处理文本的二级类目,使得可以基于匹配的方法获取待处理文本的二级类目,同时结合待处理文本的一级类目的分类信息,可以提高文本的层次分类的准确度。In the embodiment of the present application, the second classification network is first called to process the text to be processed to obtain the semantic coding representation of the text to be processed and the classification information of the primary category of the text to be processed, and then the category matching parameters encode the secondary category The representation and the semantic coding representation of the text to be processed are processed to obtain the matching result between each secondary category and the text to be processed, and the first classification network is called to process the matching result to obtain the secondary category of the text to be processed. Finally, the classification result of the text to be processed can be determined based on the classification information of the secondary category and the classification information of the primary category of the text to be processed; the text processing method encodes the secondary category through the category matching parameter. Processing with the semantic coding representation of the text to be processed can obtain the matching result between the text to be processed and the secondary category. According to the matching result, the secondary category of the text to be processed can be accurately obtained, so that the matching method can be used to obtain The secondary category of the text to be processed, combined with the classification information of the primary category of the text to be processed, can improve the accuracy of the hierarchical classification of the text.

上述详细阐述了本申请实施例的方法,为了便于更好地实施本申请实施例的上述方案,相应地,下面提供了本申请实施例的装置。请参见图6,图6是本申请一个示例性实施例提供的一种文本处理装置的结构示意图,该装置60可以包括:The methods of the embodiments of the present application are described in detail above. In order to facilitate better implementation of the above solutions of the embodiments of the present application, correspondingly, the devices of the embodiments of the present application are provided below. Please refer to FIG. 6. FIG. 6 is a schematic structural diagram of a text processing apparatus provided by an exemplary embodiment of the present application. The apparatus 60 may include:

获取模块601,用于获取待处理文本;an obtaining module 601, used for obtaining the text to be processed;

处理模块602,用于调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;The processing module 602 is configured to call the first classification network to process the secondary category coding representation, category matching parameters and the semantic coding representation of the text to be processed, and obtain the classification information of the secondary category of the text to be processed ;

处理模块602,还用于基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。The processing module 602 is further configured to determine the classification result of the text to be processed based on the classification information of the secondary category and the classification information of the primary category of the text to be processed, and the primary category of the text to be processed. The target classification information is obtained by processing the text to be processed through the second classification network.

在一个实施例中,上述获取模块601,还用于:In one embodiment, the above obtaining module 601 is further configured to:

根据预定义的类目层级结构确定多个一级类目和多个二级类目,所述二级类目为所述一级类目的下一层级的类目;Determine a plurality of first-level categories and a plurality of second-level categories according to a predefined category hierarchy, and the second-level categories are the categories of the next level of the first-level categories;

获取所述多个二级类目中每个二级类目的词编码表示;obtaining the word code representation of each secondary category in the multiple secondary categories;

根据所述多个二级类目中每个二级类目的词编码表示确定二级类目编码表示。The secondary category coding representation is determined according to the word coding representation of each secondary category in the plurality of secondary categories.

在一个实施例中,上述处理模块602,还用于:In one embodiment, the above-mentioned processing module 602 is further configured to:

利用类目匹配参数对所述二级类目编码表示和所述待处理文本的语义编码表示进行处理,确定所述每个二级类目与所述待处理文本之间的匹配结果;Use category matching parameters to process the secondary category coding representation and the semantic coding representation of the text to be processed, and determine a matching result between each secondary category and the text to be processed;

调用第一分类网络对所述每个二级类目与所述待处理文本之间的匹配结果进行处理,得到所述待处理文本的二级类目的分类信息。The first classification network is invoked to process the matching result between each secondary category and the text to be processed, to obtain the classification information of the secondary category of the text to be processed.

在一个实施例中,上述处理模块602,还用于:In one embodiment, the above-mentioned processing module 602 is further configured to:

调用第二分类网络的语义编码器对所述待处理文本进行处理,得到所述待处理文本的语义编码表示;invoking the semantic encoder of the second classification network to process the text to be processed to obtain a semantic encoding representation of the text to be processed;

调用所述第二分类网络的分类器对所述待处理文本的语义编码表示进行处理,得到所述待处理文本的一级类目的分类信息。The classifier of the second classification network is invoked to process the semantically encoded representation of the text to be processed to obtain the classification information of the primary category of the text to be processed.

在一个实施例中,上述获取模块601,还用于:In one embodiment, the above obtaining module 601 is further configured to:

获取训练样本集、二级类目编码表示和初始化的匹配参数,所述训练样本集中包括多个文本以及所述多个文本中每个文本的一级类目标签和二级类目标签;Obtaining a training sample set, a secondary category code representation and initialization matching parameters, the training sample set includes a plurality of texts and a primary category label and a secondary category label of each text in the plurality of texts;

上述处理模块602,还用于:The above-mentioned processing module 602 is also used for:

利用初始化的第一神经网络对所述训练样本集中包括的每个文本进行处理,得到所述每个文本的语义编码表示和预测的一级类目的分类信息;Use the initialized first neural network to process each text included in the training sample set to obtain the semantic coding representation of each text and the classification information of the predicted first-level category;

利用初始化的第二神经网络对所述二级类目编码表示、所述初始化的匹配参数以及所述每个文本的语义编码表示进行处理,得到所述每个文本的预测的二级类目的分类信息;The second-level category encoding representation, the initialized matching parameters, and the semantic encoding representation of each text are processed by using the initialized second neural network to obtain the predicted second-level category object for each text. Classified information;

基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,对所述第一神经网络、所述第二神经网络和所述初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络。Based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label, the first neural network , the second neural network and the initialized matching parameters are trained to obtain category matching parameters, a first classification network and a second classification network.

在一个实施例中,上述处理模块602,还用于:In one embodiment, the above-mentioned processing module 602 is further configured to:

基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,确定所述第一神经网络的第一损失值和所述第二神经网络的第二损失值;The first neural network is determined based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label of each text The first loss value of and the second loss value of the second neural network;

根据所述第一损失值和所述第二损失值确定总损失值;determining a total loss value according to the first loss value and the second loss value;

利用所述总损失值对所述第一神经网络的网络参数、所述第二神经网络的网络参数和所述初始化的匹配参数进行调整;Using the total loss value to adjust the network parameters of the first neural network, the network parameters of the second neural network and the initialized matching parameters;

当所述总损失值满足收敛条件时,训练得到类目匹配参数、第一分类网络和第二分类网络。When the total loss value satisfies the convergence condition, the category matching parameters, the first classification network and the second classification network are obtained through training.

在一个实施例中,上述处理模块602,还用于:In one embodiment, the above-mentioned processing module 602 is further configured to:

根据所述每个文本的预测的一级类目的分类信息、所述一级类目标签以及所述第一神经网络的第一损失函数,确定所述第一神经网络的第一损失值;Determine the first loss value of the first neural network according to the predicted first-level category classification information of each text, the first-level category label, and the first loss function of the first neural network;

根据所述每个文本的预测的二级类目的分类信息、所述二级类目标签以及所述第二神经网络的第二损失函数,确定所述第二神经网络的第二损失值。A second loss value of the second neural network is determined according to the predicted classification information of the secondary category of each text, the secondary category label, and the second loss function of the second neural network.

在一个实施例中,上述处理模块602,还用于:In one embodiment, the above-mentioned processing module 602 is further configured to:

根据所述第一损失值、所述第二损失值以及所述一级类目与所述二级类目之间的约束损失函数,确定第三损失值;determining a third loss value according to the first loss value, the second loss value and the constraint loss function between the primary category and the secondary category;

基于所述第一损失值、所述第二损失值、所述第三损失值,以及所述第一损失函数、所述第二损失函数和所述约束损失函数各自的权重系数确定总损失值。A total loss value is determined based on the first loss value, the second loss value, the third loss value, and the respective weight coefficients of the first loss function, the second loss function, and the constraint loss function .

本申请实施例中,首先调用第二分类网络对待处理文本进行处理得到待处理文本的语义编码表示,以及待处理文本的一级类目的分类信息,然后调用第一分类网络对二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示进行处理,得到待处理文本的二级类目的分类信息,最后基于二级类目的分类信息和待处理文本的一级类目的分类信息可以确定待处理文本的分类结果;该文本处理方法通过二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示可以得到待处理文本与二级类目之间的匹配结果,根据该匹配结果可以准确地得到待处理文本的二级类目,同时结合待处理文本的一级类目的分类信息,可以提高文本的层次分类的准确度。In the embodiment of the present application, the second classification network is first called to process the text to be processed to obtain the semantic coding representation of the to-be-processed text and the classification information of the first-level category of the to-be-processed text, and then the first classification network is called to classify the second-level category The coding representation, the category matching parameters and the semantic coding representation of the text to be processed are processed to obtain the classification information of the secondary category of the text to be processed, and finally based on the classification information of the secondary category and the primary category of the text to be processed The classification information can determine the classification result of the text to be processed; the text processing method can obtain the matching result between the text to be processed and the secondary category through the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed , according to the matching result, the secondary category of the text to be processed can be accurately obtained, and at the same time, the accuracy of the hierarchical classification of the text can be improved by combining the classification information of the primary category of the text to be processed.

图7是本申请一个示例性实施例提供的一种计算机设备的结构示意图,该计算机设备70至少包括处理器701、存储器702以及通信接口703。其中,处理器701、存储器702以及通信接口703可通过总线或者其它方式连接。通信接口703可以用于接收或者发送数据。存储器702中存储有计算机程序,计算机程序包括计算机指令。处理器701用于执行计算机程序包括的计算机指令。处理器701(或称CPU(Central Processing Unit,中央处理器))是计算机设备70的计算核心以及控制核心,其适于实现一条或多条计算机指令,具体适于加载并执行一条或多条计算机指令从而实现相应方法流程或相应功能。具体实现中,存储器702中的计算机指令由处理器701加载并执行如下步骤:FIG. 7 is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application. The computer device 70 includes at least a processor 701 , a memory 702 and a communication interface 703 . Wherein, the processor 701, the memory 702 and the communication interface 703 may be connected by a bus or other means. Communication interface 703 may be used to receive or transmit data. A computer program is stored in the memory 702, and the computer program includes computer instructions. The processor 701 is used to execute computer instructions included in a computer program. The processor 701 (or called CPU (Central Processing Unit, central processing unit)) is the computing core and the control core of the computer device 70, which is suitable for implementing one or more computer instructions, specifically suitable for loading and executing one or more computer instructions. The instruction thus implements the corresponding method flow or corresponding function. In a specific implementation, the computer instructions in the memory 702 are loaded by the processor 701 and perform the following steps:

获取待处理文本;Get the pending text;

调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;Invoking the first classification network to process the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed, to obtain the classification information of the secondary category of the text to be processed;

基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。The classification result of the text to be processed is determined based on the classification information of the secondary category and the classification information of the primary category of the text to be processed, and the classification information of the primary category of the text to be processed is obtained through the first It is obtained by processing the text to be processed by the binary classification network.

在一个实施例中,上述处理器701,还用于:In one embodiment, the above-mentioned processor 701 is further configured to:

根据预定义的类目层级结构确定多个一级类目和多个二级类目,所述二级类目为所述一级类目的下一层级的类目;Determine a plurality of first-level categories and a plurality of second-level categories according to a predefined category hierarchy, and the second-level categories are the categories of the next level of the first-level categories;

获取所述多个二级类目中每个二级类目的词编码表示;obtaining the word code representation of each secondary category in the multiple secondary categories;

根据所述多个二级类目中每个二级类目的词编码表示确定二级类目编码表示。The secondary category coding representation is determined according to the word coding representation of each secondary category in the plurality of secondary categories.

在一个实施例中,上述处理器701,还用于:In one embodiment, the above-mentioned processor 701 is further configured to:

利用类目匹配参数对所述二级类目编码表示和所述待处理文本的语义编码表示进行处理,确定所述每个二级类目与所述待处理文本之间的匹配结果;Use category matching parameters to process the secondary category coding representation and the semantic coding representation of the text to be processed, and determine a matching result between each secondary category and the text to be processed;

调用第一分类网络对所述每个二级类目与所述待处理文本之间的匹配结果进行处理,得到所述待处理文本的二级类目的分类信息。The first classification network is invoked to process the matching result between each secondary category and the text to be processed, to obtain the classification information of the secondary category of the text to be processed.

在一个实施例中,上述处理器701,还用于:In one embodiment, the above-mentioned processor 701 is further configured to:

调用第二分类网络的语义编码器对所述待处理文本进行处理,得到所述待处理文本的语义编码表示;invoking the semantic encoder of the second classification network to process the text to be processed to obtain a semantic encoding representation of the text to be processed;

调用所述第二分类网络的分类器对所述待处理文本的语义编码表示进行处理,得到所述待处理文本的一级类目的分类信息。The classifier of the second classification network is invoked to process the semantically encoded representation of the text to be processed to obtain the classification information of the primary category of the text to be processed.

在一个实施例中,上述处理器701,还用于:In one embodiment, the above-mentioned processor 701 is further configured to:

获取训练样本集、二级类目编码表示和初始化的匹配参数,所述训练样本集中包括多个文本以及所述多个文本中每个文本的一级类目标签和二级类目标签;Obtaining a training sample set, a secondary category code representation and initialization matching parameters, the training sample set includes a plurality of texts and a primary category label and a secondary category label of each text in the plurality of texts;

利用初始化的第一神经网络对所述训练样本集中包括的每个文本进行处理,得到所述每个文本的语义编码表示和预测的一级类目的分类信息;Use the initialized first neural network to process each text included in the training sample set to obtain the semantic coding representation of each text and the classification information of the predicted first-level category;

利用初始化的第二神经网络对所述二级类目编码表示、所述初始化的匹配参数以及所述每个文本的语义编码表示进行处理,得到所述每个文本的预测的二级类目的分类信息;The second-level category encoding representation, the initialized matching parameters, and the semantic encoding representation of each text are processed by using the initialized second neural network to obtain the predicted second-level category object for each text. Classified information;

基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,对所述第一神经网络、所述第二神经网络和所述初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络。Based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label, the first neural network , the second neural network and the initialized matching parameters are trained to obtain category matching parameters, a first classification network and a second classification network.

在一个实施例中,上述处理器701,还用于:In one embodiment, the above-mentioned processor 701 is further configured to:

基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,确定所述第一神经网络的第一损失值和所述第二神经网络的第二损失值;The first neural network is determined based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label of each text The first loss value of and the second loss value of the second neural network;

根据所述第一损失值和所述第二损失值确定总损失值;determining a total loss value according to the first loss value and the second loss value;

利用所述总损失值对所述第一神经网络的网络参数、所述第二神经网络的网络参数和所述初始化的匹配参数进行调整;Using the total loss value to adjust the network parameters of the first neural network, the network parameters of the second neural network and the initialized matching parameters;

当所述总损失值满足收敛条件时,训练得到类目匹配参数、第一分类网络和第二分类网络。When the total loss value satisfies the convergence condition, the category matching parameters, the first classification network and the second classification network are obtained through training.

在一个实施例中,上述处理器701,还用于:In one embodiment, the above-mentioned processor 701 is further configured to:

根据所述第一损失值、所述第二损失值以及所述一级类目与所述二级类目之间的约束损失函数,确定第三损失值;determining a third loss value according to the first loss value, the second loss value and the constraint loss function between the primary category and the secondary category;

基于所述第一损失值、所述第二损失值、所述第三损失值,以及所述第一损失函数、所述第二损失函数和所述约束损失函数各自的权重系数确定总损失值。A total loss value is determined based on the first loss value, the second loss value, the third loss value, and the respective weight coefficients of the first loss function, the second loss function, and the constraint loss function .

本申请实施例中,首先调用第二分类网络对待处理文本进行处理得到待处理文本的语义编码表示,以及待处理文本的一级类目的分类信息,然后调用第一分类网络对二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示进行处理,得到待处理文本的二级类目的分类信息,最后基于二级类目的分类信息和待处理文本的一级类目的分类信息可以确定待处理文本的分类结果;该文本处理方法通过二级类目编码表示、类目匹配参数以及待处理文本的语义编码表示可以得到待处理文本与二级类目之间的匹配结果,根据该匹配结果可以准确地得到待处理文本的二级类目,同时结合待处理文本的一级类目的分类信息,可以提高文本的层次分类的准确度。In the embodiment of the present application, the second classification network is first called to process the text to be processed to obtain the semantic coding representation of the to-be-processed text and the classification information of the first-level category of the to-be-processed text, and then the first classification network is called to classify the second-level category The coding representation, the category matching parameters and the semantic coding representation of the text to be processed are processed to obtain the classification information of the secondary category of the text to be processed, and finally based on the classification information of the secondary category and the primary category of the text to be processed The classification information can determine the classification result of the text to be processed; the text processing method can obtain the matching result between the text to be processed and the secondary category through the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed , according to the matching result, the secondary category of the text to be processed can be accurately obtained, and at the same time, the accuracy of the hierarchical classification of the text can be improved by combining the classification information of the primary category of the text to be processed.

在本申请实施例中,本申请实施例还提供了一种计算机存储介质(Memory),计算机存储介质是计算机设备70中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机存储介质既可以包括计算机设备70中的内置存储介质,当然也可以包括计算机设备70所支持的扩展存储介质。计算机存储介质提供存储空间,该存储空间存储了计算机设备70的操作系统。并且,在该存储空间中还存放了适于被处理器701加载并执行的一条或多条的计算机指令,这些计算机指令可以是一个或多个的计算机程序(包括程序代码)。需要说明的是,此处的计算机存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(Non-Volatile Memory),例如至少一个磁盘存储器;可选的还可以是至少一个位于远离前述处理器701的计算机存储介质。In the embodiments of the present application, the embodiments of the present application further provide a computer storage medium (Memory), where the computer storage medium is a memory device in the computer device 70 for storing programs and data. It can be understood that, the computer storage medium here may include both the built-in storage medium in the computer device 70 , and certainly also the extended storage medium supported by the computer device 70 . The computer storage medium provides storage space in which the operating system of the computer device 70 is stored. In addition, one or more computer instructions suitable for being loaded and executed by the processor 701 are also stored in the storage space, and these computer instructions may be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one memory located far away from the aforementioned processor. 701 computer storage medium.

本申请一个或多个实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机存储介质中。计算机设备的处理器从计算机存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述各方法的实施例中所执行的步骤。One or more embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer storage medium. The processor of the computer device reads the computer instructions from the computer storage medium, and the processor executes the computer instructions, so that the computer device performs the steps performed in the embodiments of the above methods.

以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above examples only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (10)

1.一种文本处理方法,其特征在于,所述方法包括:1. a text processing method, is characterized in that, described method comprises: 获取待处理文本;Get the pending text; 调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;Invoking the first classification network to process the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed, to obtain the classification information of the secondary category of the text to be processed; 基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。The classification result of the text to be processed is determined based on the classification information of the secondary category and the classification information of the primary category of the text to be processed, and the classification information of the primary category of the text to be processed is obtained through the first It is obtained by processing the text to be processed by the binary classification network. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, wherein the method further comprises: 根据预定义的类目层级结构确定多个一级类目和多个二级类目,所述二级类目为所述一级类目的下一层级的类目;Determine a plurality of first-level categories and a plurality of second-level categories according to a predefined category hierarchy, and the second-level categories are the categories of the next level of the first-level categories; 获取所述多个二级类目中每个二级类目的词编码表示;obtaining the word code representation of each secondary category in the multiple secondary categories; 根据所述多个二级类目中每个二级类目的词编码表示确定二级类目编码表示。The secondary category coding representation is determined according to the word coding representation of each secondary category in the plurality of secondary categories. 3.根据权利要求2所述的方法,其特征在于,所述调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息,包括:3. The method according to claim 2, characterized in that, calling the first classification network to process the secondary category coding representation, category matching parameters, and the semantic coding representation of the text to be processed, to obtain the Classification information of the secondary category of the text to be processed, including: 利用类目匹配参数对所述二级类目编码表示和所述待处理文本的语义编码表示进行处理,确定所述每个二级类目与所述待处理文本之间的匹配结果;Use category matching parameters to process the secondary category coding representation and the semantic coding representation of the text to be processed, and determine a matching result between each secondary category and the text to be processed; 调用第一分类网络对所述每个二级类目与所述待处理文本之间的匹配结果进行处理,得到所述待处理文本的二级类目的分类信息。The first classification network is invoked to process the matching result between each secondary category and the text to be processed, to obtain the classification information of the secondary category of the text to be processed. 4.根据权利要求1~3中任一项所述的方法,其特征在于,所述基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果之前,所述方法还包括:4. The method according to any one of claims 1 to 3, wherein the determining the said Before the classification result of the text to be processed, the method further includes: 调用第二分类网络的语义编码器对所述待处理文本进行处理,得到所述待处理文本的语义编码表示;invoking the semantic encoder of the second classification network to process the text to be processed to obtain a semantic encoding representation of the text to be processed; 调用所述第二分类网络的分类器对所述待处理文本的语义编码表示进行处理,得到所述待处理文本的一级类目的分类信息。The classifier of the second classification network is invoked to process the semantically encoded representation of the text to be processed to obtain the classification information of the primary category of the text to be processed. 5.根据权利要求1所述的方法,其特征在于,所述方法还包括:5. The method according to claim 1, wherein the method further comprises: 获取训练样本集、二级类目编码表示和初始化的匹配参数,所述训练样本集中包括多个文本以及所述多个文本中每个文本的一级类目标签和二级类目标签;Obtaining a training sample set, a secondary category code representation and initialization matching parameters, the training sample set includes a plurality of texts and a primary category label and a secondary category label of each text in the plurality of texts; 利用初始化的第一神经网络对所述训练样本集中包括的每个文本进行处理,得到所述每个文本的语义编码表示和预测的一级类目的分类信息;Use the initialized first neural network to process each text included in the training sample set to obtain the semantic coding representation of each text and the classification information of the predicted first-level category; 利用初始化的第二神经网络对所述二级类目编码表示、所述初始化的匹配参数以及所述每个文本的语义编码表示进行处理,得到所述每个文本的预测的二级类目的分类信息;The second-level category encoding representation, the initialized matching parameters, and the semantic encoding representation of each text are processed by using the initialized second neural network to obtain the predicted second-level category object for each text. Classified information; 基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,对所述第一神经网络、所述第二神经网络和所述初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络。Based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label, the first neural network , the second neural network and the initialized matching parameters are trained to obtain category matching parameters, a first classification network and a second classification network. 6.根据权利要求5所述的方法,其特征在于,所述基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,对所述第一神经网络、所述第二神经网络和所述初始化的匹配参数进行训练,得到类目匹配参数、第一分类网络和第二分类网络,包括:6 . The method according to claim 5 , wherein the classification information of the first-level category predicted based on the each text, the classification information of the predicted second-level category, the first-level category label and the secondary category label, train the first neural network, the second neural network and the initialized matching parameters to obtain category matching parameters, the first classification network and the second classification network, include: 基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,确定所述第一神经网络的第一损失值和所述第二神经网络的第二损失值;The first neural network is determined based on the predicted classification information of the first-level category, the predicted classification information of the second-level category, the first-level category label, and the second-level category label of each text The first loss value of and the second loss value of the second neural network; 根据所述第一损失值和所述第二损失值确定总损失值;determining a total loss value according to the first loss value and the second loss value; 利用所述总损失值对所述第一神经网络的网络参数、所述第二神经网络的网络参数和所述初始化的匹配参数进行调整;Using the total loss value to adjust the network parameters of the first neural network, the network parameters of the second neural network and the initialized matching parameters; 当所述总损失值满足收敛条件时,训练得到类目匹配参数、第一分类网络和第二分类网络。When the total loss value satisfies the convergence condition, the category matching parameters, the first classification network and the second classification network are obtained through training. 7.根据权利要求6所述的方法,其特征在于,所述基于所述每个文本的预测的一级类目的分类信息、预测的二级类目的分类信息、所述一级类目标签和所述二级类目标签,确定所述第一神经网络的第一损失值和所述第二神经网络的第二损失值,包括:7 . The method according to claim 6 , wherein the classification information of the first-level category predicted based on the each text, the classification information of the predicted second-level category, the first-level category The label and the secondary class target label determine the first loss value of the first neural network and the second loss value of the second neural network, including: 根据所述每个文本的预测的一级类目的分类信息、所述一级类目标签以及所述第一神经网络的第一损失函数,确定所述第一神经网络的第一损失值;Determine the first loss value of the first neural network according to the predicted first-level category classification information of each text, the first-level category label, and the first loss function of the first neural network; 根据所述每个文本的预测的二级类目的分类信息、所述二级类目标签以及所述第二神经网络的第二损失函数,确定所述第二神经网络的第二损失值。A second loss value of the second neural network is determined according to the predicted classification information of the secondary category of each text, the secondary category label, and the second loss function of the second neural network. 8.根据权利要求6或7所述的方法,其特征在于,所述根据所述第一损失值和所述第二损失值确定总损失值,包括:8. The method according to claim 6 or 7, wherein the determining a total loss value according to the first loss value and the second loss value comprises: 根据所述第一损失值、所述第二损失值以及所述一级类目与所述二级类目之间的约束损失函数,确定第三损失值;determining a third loss value according to the first loss value, the second loss value and the constraint loss function between the primary category and the secondary category; 基于所述第一损失值、所述第二损失值、所述第三损失值,以及所述第一损失函数、所述第二损失函数和所述约束损失函数各自的权重系数确定总损失值。A total loss value is determined based on the first loss value, the second loss value, the third loss value, and the respective weight coefficients of the first loss function, the second loss function, and the constraint loss function . 9.一种文本处理装置,其特征在于,所述装置包括:9. A text processing device, wherein the device comprises: 获取模块,用于获取待处理文本;Get module, used to get the text to be processed; 处理模块,用于调用第一分类网络对二级类目编码表示、类目匹配参数以及所述待处理文本的语义编码表示进行处理,得到所述待处理文本的二级类目的分类信息;a processing module, configured to call the first classification network to process the secondary category coding representation, the category matching parameters and the semantic coding representation of the text to be processed, to obtain the classification information of the secondary category of the text to be processed; 所述处理模块,还用于基于所述二级类目的分类信息和所述待处理文本的一级类目的分类信息确定所述待处理文本的分类结果,所述待处理文本的一级类目的分类信息是通过第二分类网络对所述待处理文本进行处理得到的。The processing module is further configured to determine the classification result of the text to be processed based on the classification information of the secondary category and the classification information of the primary category of the text to be processed. The classification information of the category is obtained by processing the text to be processed through the second classification network. 10.一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序适于由处理器加载并执行权利要求1~8任一项所述的文本处理方法。10 . A computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is adapted to be loaded by a processor and execute the text processing method according to any one of claims 1 to 8 .
CN202110812188.XA 2021-07-19 2021-07-19 Text processing method, device and computer storage medium Pending CN113821633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110812188.XA CN113821633A (en) 2021-07-19 2021-07-19 Text processing method, device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110812188.XA CN113821633A (en) 2021-07-19 2021-07-19 Text processing method, device and computer storage medium

Publications (1)

Publication Number Publication Date
CN113821633A true CN113821633A (en) 2021-12-21

Family

ID=78912781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110812188.XA Pending CN113821633A (en) 2021-07-19 2021-07-19 Text processing method, device and computer storage medium

Country Status (1)

Country Link
CN (1) CN113821633A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116821780A (en) * 2022-03-18 2023-09-29 腾讯科技(深圳)有限公司 Object classification methods, devices and equipment based on classification models
CN116932744A (en) * 2022-03-29 2023-10-24 马上消费金融股份有限公司 Text classification method, apparatus, computer device and storage medium
CN116955599A (en) * 2022-04-08 2023-10-27 腾讯科技(深圳)有限公司 Category determining method, related device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087979A1 (en) * 2000-11-16 2002-07-04 Dudkiewicz Gil Gavriel System and method for determining the desirability of video programming events using keyword matching
CN107169049A (en) * 2017-04-25 2017-09-15 腾讯科技(深圳)有限公司 The label information generation method and device of application
CN111177385A (en) * 2019-12-26 2020-05-19 北京明略软件系统有限公司 Multi-level classification model training method, multi-level classification method and device
CN112052333A (en) * 2020-08-20 2020-12-08 深圳市欢太科技有限公司 Text classification method and device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020087979A1 (en) * 2000-11-16 2002-07-04 Dudkiewicz Gil Gavriel System and method for determining the desirability of video programming events using keyword matching
CN107169049A (en) * 2017-04-25 2017-09-15 腾讯科技(深圳)有限公司 The label information generation method and device of application
CN111177385A (en) * 2019-12-26 2020-05-19 北京明略软件系统有限公司 Multi-level classification model training method, multi-level classification method and device
CN112052333A (en) * 2020-08-20 2020-12-08 深圳市欢太科技有限公司 Text classification method and device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨玉亭;冯林;代磊超;苏菡;: "面向上下文注意力联合学习网络的方面级情感分类模型", 模式识别与人工智能, no. 08, 15 August 2020 (2020-08-15) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116821780A (en) * 2022-03-18 2023-09-29 腾讯科技(深圳)有限公司 Object classification methods, devices and equipment based on classification models
CN116932744A (en) * 2022-03-29 2023-10-24 马上消费金融股份有限公司 Text classification method, apparatus, computer device and storage medium
CN116955599A (en) * 2022-04-08 2023-10-27 腾讯科技(深圳)有限公司 Category determining method, related device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN114780727B (en) Text classification method, device, computer equipment and medium based on reinforcement learning
WO2022022163A1 (en) Text classification model training method, device, apparatus, and storage medium
CN111930942B (en) Text classification method, language model training method, device and equipment
WO2021121198A1 (en) Semantic similarity-based entity relation extraction method and apparatus, device and medium
CN111967266A (en) Chinese named entity recognition model and construction method and application thereof
TW201917602A (en) Semantic encoding method and device for text capable of enabling mining of semantic relationships of text and of association between text and topics, and realizing fixed semantic encoding of text data having an indefinite length
WO2020244475A1 (en) Method and apparatus for language sequence labeling, storage medium, and computing device
CN108549646A (en) A kind of neural network machine translation system based on capsule, information data processing terminal
CN113704460A (en) Text classification method and device, electronic equipment and storage medium
CN113553510B (en) A text information recommendation method, device and readable medium
CN113590948A (en) Information recommendation method, device, equipment and computer storage medium
CN113705315A (en) Video processing method, device, equipment and storage medium
CN114492661B (en) Text data classification method and device, computer equipment and storage medium
CN110347790A (en) Text duplicate checking method, apparatus, equipment and storage medium based on attention mechanism
CN113095086B (en) Method and system for predicting source meaning
CN114490949B (en) Document retrieval method, device, equipment and medium based on BM25 algorithm
WO2025020611A1 (en) Session response method and apparatus, electronic device and storage medium
CN114417878B (en) Semantic recognition method and device, electronic equipment and storage medium
CN115510232A (en) Text sentence classification method and classification device, electronic equipment and storage medium
CN110968697A (en) Text classification method, device and equipment and readable storage medium
CN113821633A (en) Text processing method, device and computer storage medium
CN114942994A (en) Text classification method, text classification device, electronic device and storage medium
CN116821781A (en) Classification model training method, text analysis method and related equipment
CN116976315A (en) Sensitive text recognition method, device, electronic equipment and storage medium
CN114281996A (en) Long text classification method, device, equipment and storage medium

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