A few-sample legibility evaluation method, system, electronic device and storage medium

By employing a global-local cue prototype learning method combined with Bayesian probabilistic fusion, this approach addresses the shortcomings of existing readability assessment methods in feature modeling and label ambiguity, thereby improving the assessment accuracy and stability in scenarios with few samples.

CN121093973BActive Publication Date: 2026-03-27JIANGXI NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing readability assessment methods based on prompting learning suffer from poor accuracy and stability due to limited feature modeling dimensions, inadequate handling of semantic ambiguity in labels, and insufficient robustness in scenarios with few samples.

Method used

We employ a global-local cue prototype learning approach, which captures the overall semantic and lexical or sentence-level linguistic features of the text by constructing global and local cues, respectively. We then integrate multi-source prediction distributions using a Bayesian probabilistic fusion mechanism to generate the final readability level.

Benefits of technology

It achieves more comprehensive feature modeling, improves the accuracy and stability of evaluation, enhances the model's ability to distinguish factors affecting readability, and improves robustness and generalization ability in scenarios with few samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121093973B_ABST
    Figure CN121093973B_ABST
Patent Text Reader

Abstract

The application discloses a few-sample readability evaluation method and system, electronic equipment and storage medium, and belongs to the technical field of natural language processing. The method comprises the following steps: obtaining a text to be evaluated, and constructing a globally independent structure prompt and at least one local prompt for the text; inputting the text combined with the prompts into a pre-trained language model to extract global and local prompt feature representations; calculating the similarity distribution between each prompt feature representation and a plurality of preset static category prototypes, wherein the static category prototypes remain fixed during model training; based on a Bayesian probability fusion mechanism, the similarity distributions from different prompts are jointly modeled to generate a fused posterior probability distribution, and the readability level of the text is determined based on the fused posterior probability distribution. The method can effectively model multi-dimensional language features, properly handle label semantic ambiguity, and maintain high accuracy and strong robustness of readability evaluation in a few-sample scenario.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer technology, in particular to a text analysis technology in natural language processing (NLP), and especially to a few-shot readability evaluation method and system based on global-local prompt prototype learning, an electronic device and a storage medium. BACKGROUND

[0002] Text readability evaluation, which aims to automatically measure the reading and understanding difficulty of text content for a specific reader group, is a fundamental and important task in the field of natural language processing. Its application scenarios are wide, covering textbook grading and essay automatic scoring in the education field, personalized reading material recommendation in language learning applications, and user experience optimization in information retrieval and content platforms.

[0003] Traditional readability evaluation methods mainly rely on artificially designed empirical formulas, such as Flesch-Kincaid grade index, Gunning Fog index, etc. These methods calculate the readability score by calculating shallow linguistic statistical features such as word length, sentence length, and phoneme number. The advantage is simple calculation and strong interpretability. However, these methods cannot capture the deep semantic coherence, syntactic structure complexity, and discourse logical relationship of the text, so the accuracy and reliability of the evaluation results are often limited when dealing with professional or complex structured texts.

[0004] With the development of deep learning technology, especially the emergence of pre-trained language models (PLMs), readability evaluation technology has made significant progress. The PLM fine-tuning-based method can automatically learn the deep semantic and syntactic patterns of the text by training on a large amount of labeled data, thereby achieving high evaluation accuracy in multiple benchmark tests. However, this kind of supervised learning method has a core bottleneck: its performance is highly dependent on large-scale, high-quality labeled corpus. The readability level annotation work usually needs the participation of linguistics experts or education experts, and the process is time-consuming and labor-intensive, with high cost. This makes it difficult to obtain sufficient labeled data in many specific fields or low-resource languages, thereby severely restricting the application and promotion of deep learning models in these scenarios.

[0005] To address the challenge of data scarcity, few-shot readability assessment (FSRA) has become a hot research topic. Prompt learning, as a new paradigm, provides an effective solution for FSRA. This method converts downstream tasks into a form similar to pre-training tasks (such as masked language model prediction) by constructing task-related prompt templates, thereby effectively activating the knowledge contained in PLM with only a small amount of labeled samples and minimal parameter tuning.

[0006] However, the existing prompt learning-based readability assessment methods still have the following technical defects:

[0007] 1. Single feature modeling dimension: Most methods use a single global prompt structure, such as "The difficulty of this article is [MASK]." This design mainly models from the overall semantic level of the text, but ignores the fact that readability is a complex concept determined by multiple linguistic dimensions such as vocabulary, syntax, and discourse. Compressing all dimensions of features into a single prompt representation limits the model's ability to distinguish and express different readability factors, resulting in inadequate adaptability when facing different evaluation tasks.

[0008] 2. Poor handling of label semantic ambiguity: Readability level labels (such as "simple," "medium," and "difficult") are inherently subjective and semantically ambiguous, with no clear distinction between categories. Traditional prompt learning methods usually map these ambiguous labels to discrete words for prediction. This hard label mapping method cannot capture the subtle differences and transitional relationships between categories, leading to ambiguous classification boundaries and affecting evaluation accuracy.

[0009] 3. Poor robustness in few-shot scenarios: In the case of extremely limited samples, the prediction results of a single prompt are easily affected by template design and individual sample noise, resulting in large variance and uncertainty, unstable model performance, and poor generalization ability.

[0010] Therefore, how to design a readability assessment method that can effectively model multi-dimensional language features, properly handle label semantic ambiguity, and maintain high accuracy and strong robustness in few-shot scenarios is a technical problem that needs to be solved in this field. SUMMARY

[0011] The main purpose of the present application is to provide a few-shot readability assessment method, system, electronic device and storage medium based on global-local prompt prototype learning, which can overcome the defects of single prompt structure in modeling multi-dimensional language features, poor handling of semantic ambiguous labels, and poor prediction robustness in data scarce scenarios.

[0012] In a first aspect, the present application provides a few-shot readability evaluation method based on global-local prompt prototype learning, comprising the following steps:

[0013] Obtaining a text to be evaluated;

[0014] Constructing a global prompt and at least one local prompt, wherein the global prompt is used to capture the overall semantics of the text to be evaluated, and the local prompt is used to capture the linguistic features at the lexical or sentence level of the text to be evaluated;

[0015] Filling the text to be evaluated into the templates of the global prompt and the local prompt respectively, extracting the output vectors of the global prompt and the local prompt at the preset mask positions by using a pre-trained language model, and generating global prompt feature representation and local prompt feature representation;

[0016] Based on the preset category prototypes of multiple readability levels, the similarity of the global prompt feature representation and the local prompt feature representation with each category prototype is calculated respectively to obtain the category probability distribution under the global prompt and the category probability distribution under the local prompt;

[0017] Bayesian probability fusion is performed on the category probability distribution under the global prompt and the category probability distribution under the local prompt to generate a fused posterior probability distribution;

[0018] According to the fused posterior probability distribution, the final readability level of the text to be evaluated is determined.

[0019] As an optional implementation manner of the first aspect of the present application, the step of generating global prompt feature representation and local prompt feature representation further comprises: mapping the global prompt feature representation and the local prompt feature representation to a unified low-dimensional feature space through a linear transformation layer to obtain global prompt feature vectors and local prompt feature vectors, which are used for subsequent similarity calculation with the category prototypes.

[0020] As an optional implementation manner of the first aspect of the present application, in the step of capturing the linguistic features at the lexical or sentence level of the text to be evaluated, the local prompt comprises a lexical prompt and a sentence prompt; the lexical prompt is used to guide the pre-trained language model to focus on the lexical complexity of the text to be evaluated; and the sentence prompt is used to guide the pre-trained language model to focus on the syntactic structure complexity of the text to be evaluated.

[0021] As an optional implementation of the first aspect of the application, before the step of constructing the category prototype based on the preset category prototype of the plurality of readability levels, the step of constructing the category prototype comprises: extracting global prompt feature representation and local prompt feature representation of a plurality of known readability level samples by using the pre-trained language model without trained update; concatenating the global prompt feature representation and the local prompt feature representation, and performing dimension reduction processing through a linear mapping layer to obtain unified global-local prompt feature representation; aggregating the unified global-local prompt feature representation according to readability levels to generate an initial category prototype representing the central semantics of each readability level, thereby constructing a category prototype matrix.

[0022] As an optional implementation of the first aspect of the application, during the pre-training language model training stage, the category prototype is further optimized by using a combined loss function, wherein the combined loss function comprises: a triplet loss obtained by weighted summation of a first part loss with the category prototype as an anchor point and a second part loss with a sample as an anchor point; and a cross-entropy loss obtained by comparing the category probability distribution under the global prompt and the category probability distribution under the local prompt with the true label, respectively calculating global cross-entropy loss and local cross-entropy loss.

[0023] As an optional implementation of the first aspect of the application, the step of performing Bayesian probability fusion on the category probability distribution under the global prompt and the category probability distribution under the local prompt to generate a fused posterior probability distribution comprises: multiplying the probability value of each category in the category probability distribution under the global prompt with the probability value of the corresponding category in the category probability distribution under the local prompt to obtain a preliminary posterior predictive distribution; and performing normalization processing on the preliminary posterior predictive distribution to ensure that the sum of the probabilities of all categories is 1, thereby generating the fused posterior probability distribution.

[0024] As an optional implementation of the first aspect of the application, the step of obtaining the text to be evaluated comprises: obtaining a multilingual readability corpus, and performing data cleaning, word segmentation and text standardization processing on the text to be evaluated in the corpus; combining the processed text and its corresponding readability level label to form a data pair.

[0025] In a second aspect, the embodiments of the present application provide a few-shot readability evaluation system based on global-local prompt prototype learning, comprising:

[0026] A text acquisition module is configured to acquire text to be evaluated.

[0027] The prompt construction module is configured to construct a global prompt and at least one local prompt, the global prompt being used to capture the overall semantics of the text to be evaluated, and the local prompt being used to capture the linguistic features at the lexical or sentence level of the text to be evaluated;

[0028] The feature extraction module is configured to fill the text to be evaluated into the templates of the global prompt and the local prompt respectively, extract output vectors of the global prompt and the local prompt at preset mask positions respectively by using a pre-trained language model, and generate global prompt feature representation and local prompt feature representation;

[0029] The similarity calculation module is configured to calculate the similarity between the global prompt feature representation and the local prompt feature representation and each category prototype of a plurality of preset readability levels based on the category prototypes, to obtain a category probability distribution under the global prompt and a category probability distribution under the local prompt.

[0030] The probability fusion module is configured to perform Bayesian probability fusion on the category probability distribution under the global prompt and the category probability distribution under the local prompt, to generate a fused posterior probability distribution.

[0031] The level determination module is configured to determine the final readability level of the text to be evaluated according to the fused posterior probability distribution.

[0032] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, and the program or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0033] In a fourth aspect, a readable storage medium is provided, which stores a program or instructions, and the program or instructions are executed by a processor to implement the steps of the method according to the first aspect.

[0034] Compared with the prior art, the technical solution provided by the present application has the following beneficial effects:

[0035] 1. More comprehensive feature modeling and higher evaluation accuracy: The present application designs a global-local prompt cooperative structure, which enables the model to capture complementary features related to readability from the macro semantic level and the micro linguistic level (such as vocabulary and syntax). This multi-dimensional and structured feature modeling method enables the model to understand readability more deeply and comprehensively, thereby significantly improving the accuracy of evaluation.

[0036] 2. Effectively cope with label ambiguity, stronger classification discrimination: The invention introduces a static prototype learning mechanism. Before model training, an initial PLM is used to construct a fixed and representative class prototype for each readability level. This prototype serves as a stable classification anchor during training, forcing the model to learn to map the prompt representation of samples of the same class to the vicinity of the prototype. This design effectively overcomes the problem of unclear decision boundary caused by ambiguous label semantics, enhancing the model's class discrimination ability.

[0037] 3. Improve the robustness of few-shot samples, and the generalization ability of the model is better: The invention uses a Bayesian probability fusion module in the reasoning stage to jointly model the independent prediction distribution from the global and multiple local prompts. This mechanism can integrate multi-source evidence at the probability level, effectively smooth the prediction bias caused by a single prompt or noisy samples, significantly reduce the uncertainty of model prediction, and thus perform better robustness and generalization ability in the few-shot sample scenario with scarce data.

[0038] 4. Strong practicality and scalability: The method framework proposed in the invention can be directly applied to readability evaluation tasks in multiple languages and multiple fields, and its output results can provide reliable support for downstream applications such as educational resource recommendation, adaptive language learning, and content filtering. At the same time, this framework allows flexible design and addition of more dimensional local prompts to adapt to more complex evaluation needs, providing a new technical path for the deep application of pre-trained language models in vertical fields. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 A flowchart of a few-shot readability evaluation method based on global-local prompt prototype learning according to an embodiment of the invention;

[0040] Figure 2 A structure diagram of the global-local prompt construction module and the prompt representation extraction module according to an embodiment of the invention;

[0041] Figure 3 A flowchart of constructing global-local prompt class prototypes according to an embodiment of the invention;

[0042] Figure 4 A flowchart of the Bayesian probability fusion module according to an embodiment of the invention;

[0043] Figure 5 A structure diagram of a few-shot readability evaluation system based on global-local prompt prototype learning according to an embodiment of the invention. DETAILED DESCRIPTION

[0044] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present application.

[0045] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in a "or" relationship. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise explicitly specified.

[0046] Embodiment 1

[0047] Please refer to Figure 1 A flowchart of a few-shot readability evaluation method based on global-local prompt prototype learning provided by an embodiment of the present application. The method can include the following steps:

[0048] S1: Obtain the text to be evaluated.

[0049] In this step, based on the application scenario, a multi-language and multi-domain readability corpus is obtained, and the obtained text to be evaluated is cleaned (such as removing HTML tags, special characters), segmented (for languages such as Chinese), and standardized. The processed data is organized into a data pair form (text, readability level label) for subsequent steps.

[0050] Optionally, first, a multi-source and multi-lingual readability corpus is collected according to application requirements. The constructed readability corpus mainly includes three English corpora and two Chinese corpora, each corpus covers multiple languages (English, Chinese) and multiple difficulty levels (from elementary to advanced), and is organized according to the text difficulty label to form a hierarchical system. Exemplarily, it includes:

[0051] Step S11: English dataset construction. Three representative English corpora are selected: 1. WeeBit dataset, covering five different difficulty levels, with 625 texts reserved after downsampling to ensure class balance and experimental stability; 2. Cambridge dataset, derived from Cambridge English examination materials, covering five difficulty levels, with 60 texts reserved for each class after screening; 3. CLEAR dataset, containing 4724 text segments, with the original 10 grade levels merged into 5 classes to simplify the label structure and improve experimental consistency.

[0052] Step S12: Chinese dataset construction. Two Chinese corpora are selected: 1. CMT dataset, derived from primary and secondary school textbooks, with grades 1-12 merged into 5 difficulty levels to reflect the readability differences at different learning stages; 2. HSK dataset, based on Chinese Proficiency Test materials, covering six difficulty levels, with a total of 5721 articles, capable of comprehensively reflecting the graded reading characteristics of Chinese learners.

[0053] S2: Constructing global prompts and at least one local prompt, the global prompts being used to capture the overall semantics of the text to be evaluated, and the local prompts being used to capture the lexical or sentence-level linguistic features of the text to be evaluated.

[0054] In this step, structure-independent global and local prompts are designed, where global prompts are used to capture the overall structure and semantic features of the text, and local prompts are used to depict the readability features at the lexical and sentence levels, and the optimal prompt combination is selected according to the characteristics of different datasets to improve the task adaptability of the model. Specifically, two types of global and local prompts are designed:

[0055] Global prompt: The design goal is to capture the overall structure and macro semantics of the text. An exemplary global prompt template is: “This is an article with a reading difficulty of [mask]: {x}”;

[0056]

[0057] Local prompt: The design goal is to model more fine-grained linguistic features to supplement global information. In this embodiment, two types of local prompts are designed:

[0058] Lexical prompt: Aims to guide the model to focus on the complexity of vocabulary. The example template is: “From the ease of vocabulary use, this is an article with a reading difficulty of [MASK]: {x}”.

[0059] Sentential Prompt: Designed to guide the model's attention to the complexity of the syntactic structure. An example template is: "According to the difficulty and complexity of the sentence, this is an article with a reading difficulty of [mask]: {x}".

[0060]

[0061] By filling in the templates with the text to be evaluated {x}, multiple complete sequences for inputting the PLM can be generated.

[0062] S3: Fill the text to be evaluated into the templates of the global prompt and the local prompt respectively, and use the pre-trained language model to extract the output vectors of the global prompt and the local prompt at the preset mask positions, to generate global prompt feature representation and local prompt feature representation.

[0063] Referring to Figure 2 The text to be evaluated {x} is spliced with the global prompt template and each local prompt template constructed in S2 to form multiple complete input sequences. These input sequences are input into a pre-trained language model (such as BERT, RoBERTa or BigBird). The input text to be evaluated is input into the pre-trained language model (PLM) for encoding under different templates of the global prompt and the local prompt. The pre-trained language model takes the output vectors of the preset mask positions in the prompt templates as the feature representations of the corresponding prompts.

[0064]

[0065]

[0066] wherein represents the pre-trained model, is the global prompt feature representation, is the local prompt feature representation, and m represents the mth mask position.

[0067] These global prompt feature representations and local prompt feature representations are further mapped to a unified low-dimensional feature space through a linear transformation layer to obtain the final global prompt feature vector and the local prompt feature vector .

[0068] The above steps realize the cooperative modeling of global and local features of the text, which can model the overall readability using a single prompt, and enhance the sensitivity of the model to different levels of information through a multi-prompt mechanism, providing rich and complementary representations for subsequent prototype generation and classification.

[0069] S4: Based on the preset category prototype of multiple readability levels, the similarity of the global prompt feature representation and the local prompt feature representation with each category prototype is calculated respectively to obtain the category probability distribution under the global prompt and the category probability distribution under the local prompt.

[0070] As shown in Figure 3 is a flow chart for constructing global-local prompt category prototypes. The core goal of this step is to generate a prototype vector that can represent the central semantics of the category, which is used for subsequent similarity calculation and classification.

[0071] In the foregoing step, the pre-trained language model is first used to extract the feature representation of the mask position under the global prompt and the local prompt respectively, and the multi-prompt feature vector is spliced to obtain a unified global-local prompt feature representation. Then, the high-dimensional representation after splicing is reduced in dimension through a linear mapping layer to ensure that different prompt information is aligned in a unified feature space.

[0072] On this basis, this step aggregates the sample representation after dimension reduction according to the category, and then initializes to generate a category prototype matrix. The global-local prompt feature representation in the category prototype matrix is obtained based on the PLM representation without training and updating, which is used as a fixed reference center in the subsequent classification stage, as follows:

[0073]

[0074] Where c represents the number of categories, and d represents the feature dimension. The i-th row vector in the matrix is the prototype of category i, which represents the central position of the category in the semantic space and can be used as a representative feature of the sample.

[0075] At the beginning of training, the category prototype matrix is initialized as Xavier uniform distribution is used for initialization to ensure that the prototypes are evenly distributed in the feature space. Then, during the training process, the category prototype matrix will be continuously updated and optimized to gradually approach the true central features of each category to obtain the final category prototype P.

[0076] During the category prototype learning process, the similarity is measured and optimized through a triple loss to enhance the discrimination ability of the prototype. The loss consists of two parts:

[0077] 1. Taking the category prototype as an anchor point, as follows:

[0078]

[0079] In the formula, represents the triple loss calculated based on the category prototype as an anchor point, denotes the number of samples in each category, denotes the total number of categories, denotes the representative feature of the jth sample in the ith category, denotes the prototype feature of the ith category, denotes the calculation of the cosine distance function, denotes the interval parameter.

[0080] 2. Anchored by the sample, specifically as follows:

[0081]

[0082] In the formula denotes the triplet loss calculated by anchoring the sample.

[0083] The final triplet loss is the weighted sum of the two losses:

[0084]

[0085] In the formula denotes the total triplet loss, denotes the weight coefficient of the prototype loss, denotes the weight coefficient of the sample loss.

[0086] Further, after dimension alignment of the prompt feature representation obtained in step S3 and the category prototype in the vector space, the similarity distribution between the prompt feature representation and each category prototype is calculated using a similarity measure function (such as cosine similarity or Euclidean distance), and the similarity distribution is normalized by a Softmax function to obtain the probability distribution of the input text belonging to each category.

[0087] First, the sample embedding vector is calculated by cosine similarity with the pre-constructed category prototype, thereby obtaining the matching score of the sample and each category prototype:

[0088]

[0089]

[0090] In the formula denotes the global similarity function, denotes the local similarity function, denotes the global prompt feature vector, denotes the local prompt feature vector, denotes the prototype feature vector of the ith category.

[0091] On this basis, after softmax normalization, the category probability distribution under global prompting and the category probability distribution under each local prompting , which can be expressed as follows:

[0092] Global similarity distribution:

[0093]

[0094] Local similarity distribution:

[0095]

[0096] In the training phase, the above similarity distribution is compared with the true label, and a cross-entropy loss function is used for optimization to enhance the discrimination of the prompt feature representation and the static prototype class, and to weaken the uncertainty caused by the ambiguous label semantics. The specific process is as follows:

[0097]

[0098]

[0099] wherein represents the global cross-entropy loss, represents the local cross-entropy loss.

[0100] S5: Perform Bayesian probability fusion on the class probability distribution under the global prompt and the class probability distribution under the local prompt to generate a fused posterior probability distribution.

[0101] In its inference phase, the present application uses a Bayesian probability fusion mechanism to jointly model the prediction distribution from the global prompt and multiple local prompts to obtain the final posterior prediction distribution:

[0102]

[0103] wherein n is the number of local prompts.

[0104] The above results are normalized to ensure that the sum of the probabilities of all classes is 1, and the fused prediction distribution is finally output as the readability level result of the text, providing support for content adaptation in downstream educational resource recommendation, language learning system and information retrieval.

[0105] S6: Determine the final readability level of the text to be evaluated according to the fused posterior probability distribution.

[0106] Illustratively, the class with the maximum probability value is selected from the fused posterior probability distribution as the final readability level of the text to be evaluated. The readability level of the text is output based on the fused prediction distribution, and the result is applied to content filtering and adaptation in educational resource recommendation, language learning system and information retrieval.

[0107] The Bayesian fusion mechanism can effectively alleviate the deviation problem of single prompt prediction under the condition of a small sample, thereby significantly improving the stability and generalization ability of classification.

[0108] In summary, the application proposes a few-shot readability evaluation method based on global-local prompt prototype learning. The method designs multiple structure-independent prompts to model readability features from global semantic and local linguistic aspects (such as vocabulary and sentences), and constructs prototype representations for different categories in the semantic space, thereby improving the clarity and distinguishability of feature representation. Compared with methods that rely only on global prompts, global-local prompt prototype learning can better capture readability factors at different levels and enhance the generalization ability of the model in cross-domain and cross-corpus tasks. In addition, the application introduces a Bayesian probability fusion mechanism to explicitly model uncertainty during prediction and integrate prediction results from different prompts. When there is a disagreement between prompt outputs or the posterior distribution is inconsistent, this mechanism can improve the stability and robustness of prediction through probability weighting, further improving the reliability of the model in a few-shot scenario.

[0109] Embodiment 2

[0110] Please refer to Figure 5 , which is a structure schematic diagram of a few-shot readability evaluation system based on global-local prompt prototype learning proposed by the second embodiment of the application. The system includes the following key modules:

[0111] The text acquisition module 100 is used to acquire the text to be evaluated.

[0112] The prompt construction module 200 is used to construct a global prompt and at least one local prompt. The global prompt is used to capture the overall semantics of the text to be evaluated, and the local prompt is used to capture the linguistic features of the text to be evaluated at the vocabulary or sentence level.

[0113] The feature extraction module 300 is used to fill the global prompt and the local prompt into the templates of the global prompt and the local prompt, respectively, and extract the output vectors of the global prompt and the local prompt at the preset mask positions using a pre-trained language model, to generate global prompt feature representation and local prompt feature representation.

[0114] The similarity calculation module 400 is used to calculate the similarity between the global prompt feature representation and the local prompt feature representation and each category prototype based on a plurality of pre-set category prototypes of readability levels, to obtain a category probability distribution under the global prompt and a category probability distribution under the local prompt.

[0115] The probability fusion module 500 is configured to perform Bayesian probability fusion on the category probability distribution under the global prompt and the category probability distribution under the local prompt to generate a fused posterior probability distribution.

[0116] The grade determination module 600 is configured to determine a final readability grade of the text to be evaluated according to the fused posterior probability distribution.

[0117] The few-shot readability evaluation system based on global-local prompt prototype learning in the embodiment of the application can be a device, a component, an integrated circuit or a chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), etc., and the embodiment of the application is not limited in this regard.

[0118] The few-shot readability evaluation system based on global-local prompt prototype learning in the embodiment of the application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system or other possible operating systems, and the embodiment of the application is not limited in this regard.

[0119] The few-shot readability evaluation system based on global-local prompt prototype learning provided in the embodiment of the application can implement the method embodiment. Figure 1 The processes of the few-shot readability evaluation method based on global-local prompt prototype learning implemented in the method embodiment are not repeated here.

[0120] Optionally, the embodiment of the application further provides an electronic device, which includes a processor, a memory, a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, the processes of the above-mentioned few-shot readability evaluation method based on global-local prompt prototype learning are implemented, and the same technical effects can be achieved. The processes are not repeated here.

[0121] The embodiment of the application further provides a readable storage medium, which stores programs or instructions, and the programs or instructions are executed by a processor to realize each process of the embodiment of the method for evaluating readability based on global-local prompt prototype learning with few samples, and achieve the same technical effects. To avoid repetition, details are not described herein.

[0122] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0123] It should be noted that in this document, the terms “comprising”, “including”, or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or include elements inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement “including a” does not exclude the presence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the application is not limited to the order of performing functions as shown or discussed, but can also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.

[0124] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment method can be realized by means of software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the application.

[0125] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative, but not restrictive, and a person of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims.

Claims

1. A few-shot readability evaluation method based on global-local cue prototype learning, characterized in that, The method comprises the following steps: obtaining a text to be evaluated; constructing a global prompt for capturing the overall semantics of the text to be evaluated and at least one local prompt for capturing the linguistic features at the lexical or sentence level of the text to be evaluated; filling the text to be evaluated into the templates of the global prompt and the local prompt respectively, extracting the output vectors of the global prompt and the local prompt at the preset mask positions by using a pre-trained language model, and generating global prompt feature representation and local prompt feature representation; calculating the similarity between the global prompt feature representation and the local prompt feature representation and each category prototype based on the preset category prototypes of multiple readability levels, to obtain a category probability distribution under the global prompt and a category probability distribution under the local prompt; performing Bayesian probability fusion on the category probability distribution under the global prompt and the category probability distribution under the local prompt to generate a fused posterior probability distribution; determining the final readability level of the text to be evaluated according to the fused posterior probability distribution.

2. The few-shot readability evaluation method based on global-local prompt prototype learning according to claim 1, wherein, The step of generating global prompt feature representation and local prompt feature representation further comprises: mapping the global prompt feature representation and the local prompt feature representation to a unified low-dimensional feature space through a linear transformation layer to obtain global prompt feature vectors and local prompt feature vectors for subsequent similarity calculation with the category prototypes.

3. The few-shot readability evaluation method based on global-local prompt prototype learning according to claim 1, characterized in that, In the step of capturing the linguistic features at the lexical or sentence level of the text to be evaluated by the local prompt, the local prompt comprises a lexical prompt and a sentence prompt; the lexical prompt is used to guide the pre-trained language model to focus on the lexical complexity of the text to be evaluated; the sentence prompt is used to guide the pre-trained language model to focus on the syntactic structure complexity of the text to be evaluated.

4. The few-shot readability evaluation method based on global-local prompt prototype learning according to claim 1, characterized in that, Before the step of constructing category prototypes based on the preset category prototypes of multiple readability levels, the construction step of the category prototypes comprises: extracting global prompt feature representation and local prompt feature representation of multiple known readability level samples by using the pre-trained language model without updating; concatenating the global prompt feature representation and the local prompt feature representation, and performing dimension reduction processing through a linear mapping layer to obtain unified global-local prompt feature representation; aggregating the unified global-local prompt feature representation according to readability levels to generate an initial category prototype representing the central semantics of each readability level, forming a category prototype matrix.

5. The few-shot readability evaluation method based on global-local prompt prototype learning according to claim 4, characterized in that, In the pre-training language model training stage, the category prototypes are further optimized by using a combined loss function, and the combined loss function comprises: a triplet loss obtained by weighted summation of a first part loss with the category prototype as an anchor point and a second part loss with a sample as an anchor point; and a cross-entropy loss obtained by comparing the category probability distribution under the global prompt and the category probability distribution under the local prompt with the true label to calculate global cross-entropy loss and local cross-entropy loss respectively.

6. The few-shot readability evaluation method based on global-local prompt prototype learning according to claim 1, characterized in that, The step of performing Bayesian probability fusion on the category probability distribution under the global prompt and the category probability distribution under the local prompt to generate a fused posterior probability distribution comprises: The probability value of each category in the category probability distribution under the global prompt is multiplied by the probability value of the corresponding category in the category probability distribution under the local prompt to obtain a preliminary posterior prediction distribution. The preliminary posterior prediction distribution is normalized to ensure that the sum of the probabilities of all categories is 1, thereby generating the fused posterior probability distribution.

7. The few-shot readability evaluation method based on global-local prompt prototype learning according to claim 1, characterized in that, The step of obtaining the text to be evaluated comprises: Obtain a multilingual readability corpus, and perform data cleaning, word segmentation, and text standardization processing on the text to be evaluated in the corpus; Combine the processed text and its corresponding readability level label to form a data pair.

8. A few-shot readability evaluation system based on global-local cue prototype learning, characterized in that, Comprise: A text acquisition module for acquiring a text to be evaluated; A prompt construction module for constructing a global prompt and at least one local prompt, the global prompt being used to capture the overall semantics of the text to be evaluated, and the local prompt being used to capture the linguistic features of the text to be evaluated at the lexical or sentence level; A feature extraction module for filling the text to be evaluated into the templates of the global prompt and the local prompt respectively, and extracting output vectors at preset mask positions of the global prompt and the local prompt using a pre-trained language model to generate global prompt feature representations and local prompt feature representations; A similarity calculation module for calculating the similarity between the global prompt feature representations and the local prompt feature representations and each category prototype of a plurality of preset readability levels based on the category prototypes, to obtain a category probability distribution under the global prompt and a category probability distribution under the local prompt; A probability fusion module for performing Bayesian probability fusion on the category probability distribution under the global prompt and the category probability distribution under the local prompt to generate a fused posterior probability distribution; A level determination module for determining the final readability level of the text to be evaluated based on the fused posterior probability distribution.

9. An electronic device, comprising: Comprise a processor, a memory, and a program or instructions stored on the memory and executable on the processor, when the program or instructions are executed by the processor, the steps of a global-local prompt prototype learning based on a few-shot readability evaluation method according to any one of claims 1-7.

10. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of a global-local prompt prototype learning based on a few-shot readability evaluation method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Text readability automatic evaluation method and device

    CN113343690A

  • Text readability evaluation method and system based on international Chinese education Chinese level grade standard

    CN115859962A