A Korean context suggestion method and apparatus, an electronic device, and a storage medium

By combining rule-based and neural network methods, a Korean contextual prompting system was constructed, which addresses the shortcomings of existing tools in grammatical analysis and context construction, achieving accurate grammatical explanations and vocabulary usage prompts, thereby improving learning efficiency and quality.

CN120297230BActive Publication Date: 2026-04-28HARBIN NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN NORMAL UNIVERSITY
Filing Date
2025-01-15
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing Korean learning tools are inadequate in providing contextual prompts, failing to accurately analyze grammatical structures, vocabulary semantics, and construct complete contextual scenarios, resulting in low learning efficiency.

Method used

Employing a combination of rule-based and neural network approaches, this study constructs a detailed contextual framework using a Korean grammar rule base, part-of-speech tagging algorithm, dependency parsing, attention mechanism neural network model, and language style judgment algorithm. This framework provides accurate grammatical explanations, vocabulary usage, and contextual cues.

Benefits of technology

It improves the efficiency and quality of Korean language learning, helps learners understand grammar rules, master vocabulary usage, accurately construct contextual scenarios, and adapt to language development and changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297230B_ABST
    Figure CN120297230B_ABST
Patent Text Reader

Abstract

The application provides a Korean context prompting method and device, electronic equipment and storage medium, and belongs to the language learning field. The application solves the problem that the existing prompting method cannot construct a complete context scene framework, which makes it difficult for learners to effectively understand the context, resulting in low language learning efficiency. A Korean context prompting method includes obtaining text information, converting it to a standard format using a character encoding conversion algorithm, segmenting the text, and generating formatted text data; determining the main syntax components, optimizing the preliminary analysis results, and constructing a complete syntax tree structure; defining the semantics of Korean vocabulary in the text data, querying in the database, and using a neural network model based on the attention mechanism to determine the specific semantics of Korean vocabulary in the current context; performing theme domain analysis and extracting key information to construct a complete context scene framework; and generating prompt information using a context prompting generation algorithm based on the context scene framework. It is mainly used for Korean learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of language learning, and in particular relates to a method, device, electronic device and storage medium for providing contextual prompts in Korean. Background Technology

[0002] In the field of Korean language learning, traditional language learning tools and methods have revealed many shortcomings when faced with the complex language structure, diverse vocabulary and semantics, and rich contextual scenarios of Korean.

[0003] While current Korean learning resources are abundant, they suffer from significant shortcomings in providing contextual clues. On the one hand, existing learning tools lack precision in their analysis of Korean grammatical structures, failing to meet learners' needs for a deeper understanding of grammatical details. For example, when dealing with unique Korean particles, word endings, and complex sentence structures, errors or incomplete analyses frequently occur, leading to confusion for learners in understanding and using Korean.

[0004] On the other hand, the processing of lexical semantics is rather simplistic, failing to comprehensively and accurately present the meanings and usages of words in different contexts. The polysemy of Korean vocabulary and its collocational relationships with other words make it difficult for learners to accurately grasp the true meaning of words during the learning process.

[0005] Furthermore, existing language learning tools lack a systematic and targeted approach to extracting and providing contextual information. They are unable to effectively identify and utilize key information in the text, such as people, places, times, and events, making it difficult to construct a complete and accurate contextual scene framework. This hinders learners' ability to deeply understand the situations and emotions expressed by the language when learning Korean, making it difficult to combine learned knowledge with practical application. Summary of the Invention

[0006] In view of this, the present invention aims to propose a Korean contextual prompting method, device, electronic device and storage medium to solve the problem that existing prompting methods cannot construct a complete contextual scene framework, making it difficult for learners to effectively understand the situation and resulting in low language learning efficiency.

[0007] To achieve the above objectives, the present invention adopts the following technical solution: According to a first aspect of the present invention, a method for providing Korean contextual prompts is provided, comprising the following steps:

[0008] The text information is obtained, and it is converted into a standard format using a character encoding conversion algorithm. The text is then segmented by words and punctuation using a Korean character segmentation algorithm, and part-of-speech tagging algorithm is used to tag each word with its part of speech, generating formatted text data.

[0009] Based on a pre-built Korean grammar rule base, a rule-based grammar analysis algorithm is first used to perform preliminary grammar parsing on the formatted text data and determine the main grammar components. Then, a neural network-based dependency parsing algorithm is used to optimize the preliminary parsing results, determine the sentence structure and grammar knowledge points, and construct a complete syntax tree structure.

[0010] Define the semantics of Korean words in text data, query the database, and combine the grammatical position of Korean words in sentences, the grammatical and semantic relationships with adjacent words, and contextual information. Use an attention-based neural network model to determine the specific semantics of Korean words in the current context.

[0011] Text classification algorithms are used to perform topic domain analysis on text data, key information is extracted through information extraction algorithms, and language style judgment algorithms are used to determine the language style of the text based on grammatical structure, lexical semantics, and extracted key information, thereby constructing a complete contextual scene framework.

[0012] Based on the contextual scenario framework, a contextual prompt generation algorithm is used to generate prompt information.

[0013] Furthermore, the standard format is UTF-8.

[0014] Furthermore, the part-of-speech tagging algorithm is a Hidden Markov Model (HMM) based part-of-speech tagging algorithm that employs a semi-supervised learning method and is trained by combining a small amount of manually labeled Korean corpus with a large amount of unlabeled corpus.

[0015] Furthermore, the Korean grammar rule base is constructed based on context-free grammar and stores Korean grammar rules in Backus paradigm. The rule-based grammar analysis algorithm uses a recursive approach to perform top-down or bottom-up grammar parsing on the text according to the grammar rules. The neural network-based dependency parsing algorithm uses a bidirectional recurrent neural network architecture to determine the dependency relationships between words by learning from a large amount of Korean corpus in order to optimize the syntax tree structure.

[0016] Furthermore, the database includes a Korean dictionary database and an online corpus.

[0017] Furthermore, the attention-based neural network model is based on the Transformer architecture, which determines the semantics of words by learning the grammatical and semantic features of words as well as contextual information.

[0018] Furthermore, the text classification algorithm is based on the Naive Bayes algorithm, which determines the topic domain of Korean texts by extracting features and calculating probabilities from different topic domains. The information extraction algorithm includes named entity recognition technology based on a pre-trained neural network model and a time expression recognition algorithm based on regular expressions and a time keyword library, used to extract key information about people, places, and times from the text. The language style judgment algorithm is based on decision trees or their ensemble learning improvement models, which judges the language style of the text by analyzing grammatical structure features, vocabulary usage features, topic domains, and key information, and extracts corresponding style feature indicators. The contextual prompt generation algorithm is based on template matching and natural language generation technology, which generates contextual prompt information by combining predefined prompt templates and rules with grammatical structure, vocabulary semantics, contextual information, and language style analysis results.

[0019] According to a second aspect of the present invention, a Korean context prompting device is provided, comprising:

[0020] The acquisition and preprocessing module is used to acquire text information, convert it into a standard format using a character encoding conversion algorithm, segment the text by words and punctuation using a Korean character segmentation algorithm, and label each word with a part-of-speech tagging algorithm to generate formatted text data.

[0021] The grammar structure analysis module is used to perform preliminary grammatical analysis on formatted text data and determine the main grammatical components based on a pre-built Korean grammar rule base. Then, a neural network-based dependency parsing algorithm is used to optimize the preliminary analysis results, determine the sentence structure and grammatical knowledge points, and construct a complete grammar tree structure.

[0022] The lexical semantic analysis module is used to define the semantics of Korean words in text data. It queries the database and combines the grammatical position of Korean words in sentences, the grammatical and semantic relationships with adjacent words, and contextual information. It uses an attention-based neural network model to determine the specific semantics of Korean words in the current context.

[0023] The context information extraction module is used to perform topic domain analysis on text data using text classification algorithms, extract key information through information extraction algorithms, and use language style judgment algorithms to determine the language style of the text based on grammatical structure, lexical semantics, and extracted key information, thereby constructing a complete context scene framework.

[0024] The contextual prompt generation and output module is used to generate prompt information based on the contextual scene framework and using a contextual prompt generation algorithm.

[0025] According to a third aspect of the present invention, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the Korean contextual prompting method as described in the above embodiments.

[0026] According to a fourth aspect of the present invention, a computer-readable storage medium is provided that stores a computer program, which, when executed by a processor, implements the above-described Korean contextual prompting method.

[0027] Compared with the prior art, the beneficial effects of the present invention are:

[0028] 1. By constructing a Korean grammar rule base and employing a grammatical analysis algorithm that combines rule-based and statistical methods, the system can accurately identify the structure and grammatical components of Korean sentences. When dealing with complex Korean particles, word endings, and sentence structures, it provides detailed and accurate analysis, helping learners understand grammatical rules and master correct grammatical expressions. For example, for common honorifics in Korean, grammatical analysis can accurately determine their usage scenarios and rules, enabling learners to avoid misunderstandings due to grammatical errors in communication.

[0029] 2. Utilizing local Korean dictionary databases and online corpora, combined with attention-based neural network models, the system can comprehensively and accurately determine the meaning and usage of words in different contexts. It provides detailed explanations and examples of the polysemy of Korean words and their collocational relationships with other words, helping learners to deeply understand the connotations of vocabulary. For example, when learning Korean verbs, by analyzing their collocations with different objects and their semantic changes in different contexts, learners can accurately grasp the usage of verbs.

[0030] 3. By utilizing text classification algorithms, information extraction algorithms, and language style judgment algorithms, key information in the text can be extracted to construct a complete contextual framework. This enables learners to clearly understand the situation and emotions described in the text, combining learned knowledge with practical application. For example, when learning Korean articles, learners can extract elements such as the theme, characters, location, time, and events based on contextual information, thereby better understanding the content of the article.

[0031] 4. The contextual prompting method of this patent provides learners with comprehensive learning assistance, helping them improve learning efficiency and quality. By providing detailed grammatical explanations, vocabulary semantic descriptions, and contextual prompts, learners can better understand the Korean language and master language usage skills. At the same time, diverse output methods, such as pop-ups, floating annotations, illustrated displays, audio output, and printable document formats, meet the learning needs of different learners, making the learning process more convenient and engaging.

[0032] 5. As the Korean language continues to develop and change, this patent can keep up with these changes by updating the database and model, providing learners with the latest language knowledge and learning resources. For example, when new vocabulary appears or grammatical rules change, relevant information can be updated in a timely manner, enabling learners to adapt to language development and improve learning outcomes. Attached Figure Description

[0033] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0034] Figure 1 This is a flowchart of a Korean context prompting method according to the present invention;

[0035] Figure 2 This is a structural block diagram of a Korean language context prompting device according to the present invention;

[0036] Figure 3 This is a structural block diagram of the electronic device described in this invention. Detailed Implementation

[0037] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0038] The following description, with reference to the accompanying drawings, describes a Korean contextual prompting method, apparatus, electronic device, and storage medium according to embodiments of the present invention.

[0039] Specifically, Figure 1 This is a flowchart illustrating a Korean contextual prompting method provided in an embodiment of the present invention.

[0040] like Figure 1 As shown, this Korean contextual prompting method includes the following steps:

[0041] In step S101, text information is obtained, and it is converted into a standard format using a character encoding conversion algorithm. The text is then segmented by words and punctuation using a Korean character segmentation algorithm, and part-of-speech tagging algorithm is used to tag the part of speech of each word to generate formatted text data.

[0042] Text information can be obtained by combining text input with voice input.

[0043] For text input, use a programming language (such as Python's open() function) to read the contents of files in various common formats (such as .txt, .doc, .pdf, etc.) and convert them into string format to store in memory for subsequent processing.

[0044] For voice input, a mature speech recognition engine (such as Baidu Speech Recognition API or Google Cloud Speech Recognition Service) is integrated. By calling the provided Software Development Kit (SDK), the Korean speech data collected by the device is sent to the cloud for recognition. The speech recognition engine is based on deep learning technology, such as using a Convolutional Neural Network (CNN) to extract features from the speech signal, then using a Long Short-Term Memory Network (LSTM) to perform sequence modeling on the extracted features, and finally converting the speech into Korean text information, which is then returned to the system.

[0045] During character encoding conversion, Python's `encode()` and `decode()` methods are used to uniformly convert the acquired text to UTF-8 encoding format, ensuring compatibility and consistency across different systems and environments. An encoding error detection and correction mechanism is also added. Algorithms based on character frequency statistics and language models are used to automatically detect and repair potential encoding errors, ensuring the integrity and accuracy of the text data. For text segmentation, a Korean character segmentation algorithm based on finite state automata principles is employed. A finite state machine is constructed, defining different states (such as the initial state, word middle state, punctuation mark state, etc.) and transition rules between states. Character embedding technology from deep learning is introduced, enabling the automaton to make more intelligent state transition decisions based on the semantic and syntactic features of Korean characters. By reading characters one by one from the text, the state is updated according to the current character and the previous state, following predefined transition rules. When a specific state change occurs (such as transitioning from the word middle state to the punctuation mark state), the segmentation position of a word or punctuation mark is determined, thereby accurately segmenting the text into basic units such as words and punctuation marks.

[0046] For part-of-speech tagging (POS), a Hidden Markov Model (HMM)-based algorithm is employed. First, a Korean POS-tagged corpus is constructed. Statistical analysis of a large amount of POS-tagged Korean text yields the probability (emission probability) of each POS in different contexts and the transition probability between POS. During the tagging process, for the text to be tagged, the Viterbi algorithm is used to find the most probable POS sequence. The Viterbi algorithm, using dynamic programming, calculates the probability of all possible paths from the initial state to the current position at each word location, retaining the path with the highest probability and its corresponding POS tagging result. Ultimately, each word is tagged with its corresponding POS, such as noun, verb, adjective, particle, etc., transforming the text into a format suitable for subsequent analysis. A semi-supervised learning method is used, combining a small amount of manually annotated high-quality Korean corpus with a large amount of unannotated corpus for training. Through techniques such as co-training or self-training, the parameters of the POS tagging model are continuously expanded and optimized to improve the accuracy and generalization ability of POS tagging. Simultaneously, a dynamic lexicon update mechanism is utilized to incorporate newly emerging Korean words and their parts-of-speech information in real time, maintaining the timeliness of part-of-speech tagging. Specific applications of Hidden Markov Models:

[0047] Input phase:

[0048] In the Korean context prompting method of this patent, the input is preprocessed formatted text data. (Korean sentences are used as examples.) For example, after text acquisition and preprocessing, this sentence is segmented into word sequences. The words are labeled with information such as part-of-speech tagging. When these words enter the bidirectional recurrent neural network, they are transformed into corresponding vector representations. For example, through word embedding technology, each Korean word is mapped to a low-dimensional continuous vector, making semantically similar words closer together in the vector space. These vectors are the inputs X1, X2, X3, etc., which are sequentially fed into the bidirectional recurrent neural network. The corresponding vector is X1. The corresponding vector is X2. The corresponding vector is X3.

[0049] Forward RNN processing: A forward RNN starts processing from the beginning of the sentence. When When the vector X1 enters the forward RNN, it, along with the hidden state from the previous time step (the initial hidden state is usually set to zero), is processed by a series of weight matrices and activation functions (such as tanh or ReLU) to obtain the hidden state hf1 for the first time step. This hf1 not only contains... The information from the word itself, along with the contextual information from the beginning of the sentence, is initially integrated.

[0050] Then, when When vector X2 enters the computation, it is calculated together with hf1 to obtain hf2. At this point, hf2 contains... and Information about the two words and their order. And so on, when... When vector X3 enters the sentence, it is combined with hf2 to calculate hf3, which integrates information from beginning to end of the sentence. In this patent, the forward RNN gradually captures the preceding context information of words in the sentence in this way, providing a basis for determining the dependencies between words. For example, in judging... When reading the executor of this action, a positive RNN can... Begin by gradually accumulating information to prepare for subsequent judgments on subject-verb relationships.

[0051] Reverse RNN processing: The reverse RNN starts processing from the end of the sentence. The vector X3 first enters the reverse RNN and is calculated together with the hidden state of the reverse RNN at the initial time step (also set as zero vector) to obtain the hidden state hb3 of the first time step (from the reverse perspective).

[0052] Then The vector X2 is input, and combined with hb3, hb2 is calculated. At this point, hb2 contains... and Information from back to front. When When vector X1 enters the sentence, it is combined with hb2 to calculate hb1, which integrates the information of the entire sentence from back to front. In this patent, the inverse RNN captures the contextual information of words in the sentence. For example, in judging... When considering the relationship between (book) and other words, the inverse RNN can... This action initiates, combined with The positional information that follows provides a basis for determining the verb-object relationship.

[0053] Merging and Dependency Determination: At each time step, the hidden layer outputs of the forward RNN and the backward RNN are merged. For example, in the first time step, hf1 and hb1 are merged to obtain h1. The merging can be done by concatenation, that is, joining the vectors of hf1 and hb1 in order to form a new vector h1; or by weighted summation or other methods. The merged h1 contains... The complete context of this word.

[0054] The merged hidden layer outputs h1, h2, h3, etc., are fed into subsequent layers (such as fully connected layers) for further processing to determine the dependencies between words. In this patent, a syntax tree structure can be constructed based on this information. For example, based on the information contained in h1, h2, and h3, it can be determined that... yes The subject, yes The object is determined by constructing corresponding edges in the syntax tree to represent subject-verb and verb-object relations. This optimizes the syntax tree structure initially constructed by the rule-based syntax analysis algorithm, enabling the syntax tree to more accurately reflect the grammatical and semantic relationships of the sentence and providing a more reliable foundation for subsequent contextual prompt generation.

[0055] In step S102, based on the pre-built Korean grammar rule base, a rule-based grammar analysis algorithm is first used to perform preliminary grammar parsing on the formatted text data and determine the main grammar components. Then, a neural network-based dependency parsing algorithm is used to optimize the preliminary parsing results, determine the sentence structure and grammar knowledge points, and construct a complete syntax tree structure.

[0056] This paper constructs a Korean grammar rule base based on Context-Free Grammar (CFG), using Backus Normal Form (BNF) to formally describe the grammatical rules of Korean. For example, for the basic structure of a Korean declarative sentence, the rule is defined as: <sentence>::=<subject><verb>|<subject><object><verb>, where <subject> can be further defined as the verb beginning with a specific particle (e.g., ...). Noun phrases ending in ) have a predicate consisting of a verb and its related suffixes, and an object consisting of ) Noun phrases marked with particles, etc. By recursively applying these rules, top-down or bottom-up grammatical analysis is performed on the preprocessed text to identify the main grammatical components such as subject, predicate, and object in the sentence, and to construct a preliminary syntax tree structure. During the analysis, a grammatical analysis stack is maintained to store the grammatical components to be analyzed and intermediate results. When a structure conforming to the grammatical rules is encountered, the corresponding grammatical component is popped from the stack, and nodes and edges of the syntax tree are constructed. The grammatical analysis results are further optimized using a dependency parsing model based on a bidirectional recurrent neural network (Bi-RNN). First, a large amount of Korean corpus is preprocessed, converting the words in each sentence into pre-trained word vectors (word vectors trained on a large-scale Korean corpus using Word2Vec or GloVe models), which serve as input features for the Bi-RNN. The Bi-RNN consists of two RNNs, forward and backward, which can simultaneously capture the forward and backward contextual information of words in a sentence. Through learning the word vector sequence, the model outputs the probability distribution of dependency relationships between each word and other words. Building upon this foundation, an algorithm based on Maximum Spanning Tree (MST) is used to construct a dependency syntax tree for the sentence based on dependency relation probabilities. This refines and supplements the grammatical relations in the initial syntax tree, accurately determining the sentence type (e.g., declarative, interrogative, imperative) and the relevant grammatical knowledge points (e.g., tense is determined by verb ending rules, voice is determined by particles and verb forms, and honorifics are identified based on specific honorific endings and vocabulary usage). For example, for sentence structures with grammatical ambiguity, the model can select the most reasonable grammatical parsing result based on dependency relation statistics of similar structures in the corpus, thereby improving the accuracy and robustness of grammatical analysis.

[0057] The neural network-based dependency parsing algorithm in the syntax analysis engine periodically updates and optimizes the model using new Korean corpora. It employs online learning algorithms, such as stochastic gradient descent (SGD), to continuously adjust model parameters based on new corpus samples, adapting to the evolution of Korean grammar and emerging linguistic phenomena. During the update process, new corpora are preprocessed and vectorized before being input into the model in mini-batches. The SGD algorithm calculates the gradient of the model parameters and updates them, enabling the model to continuously learn new grammatical patterns and language rules.

[0058] In step S103, the semantics of Korean words in the text data are defined. The database is queried, and the specific semantics of Korean words in the current context are determined by combining the grammatical position of Korean words in the sentence, the grammatical and semantic relationships with adjacent words, and the contextual information. A neural network model based on the attention mechanism is used.

[0059] The database comprises a local Korean dictionary database and an online corpus. The local Korean dictionary database is built using a relational database management system (such as MySQL). Multiple tables are created, including a vocabulary table (stores basic information about words, such as word ID, Korean word, part of speech, basic definition, etc.), a collocation table (stores common collocation information for words, associated with the vocabulary table via word ID, including collocation ID, collocation word, collocation type, etc.), and a semantic table (records different meanings of words and examples, associated with the vocabulary table, including semantic ID, meaning description, example sentences, etc.). Efficient retrieval of basic vocabulary information, collocations, and semantics is achieved through SQL queries. The online corpus utilizes web crawling technology based on the Scrapy framework to regularly scrape the latest vocabulary usage information from authoritative Korean learning websites (such as Naver Dictionary, Korean learning forums, etc.), academic literature databases (such as Korean academic journal databases), and Korean news media (such as Yonhap News Agency website). The Spider class in the Scrapy framework is used to define the crawler's behavior. It extracts relevant text data from web pages, including Korean vocabulary, grammar usage, and semantic evolution, using XPath or CSS selectors, and stores this data in a distributed file system (such as Ceph). During storage, the data is categorized and organized, for example, by vocabulary, grammar points, or subject areas, and index files are created to facilitate quick location and retrieval of the required data.

[0060] A neural network model based on an attention mechanism (using a Transformer architecture) is employed to determine the specific semantics of words in the current context. Preprocessed Korean text is input into the model. First, each word in the text is converted into a vector representation through a word embedding layer (e.g., using pre-trained Korean word vectors or word vectors trained from scratch on the system's corpus). Then, multiple Transformer encoding layers are passed through which the attention mechanism allows the model to dynamically pay attention to other related words in the text while processing each word, thereby better capturing the semantic relationships between words. For words with multiple meanings, the model uses its grammatical position (determined by node position in the syntax tree), grammatical relationships with adjacent words (e.g., subject-verb, verb-object, modification relationships, etc., determined by the edges and node attributes of the syntax tree), and contextual information (extracting the five words before and after the word as a context window, and concatenating or summing the vector representations of these words as contextual features) as part of the input features. Through learning from a large amount of semantically annotated Korean corpus, the model can output the most likely semantic category of a word in the current context. For example, for a Korean word... When the model detects a verb-object relationship between a word representing a location and the context involves travel-related words, it focuses on this key information through an attention mechanism to determine its semantic meaning as "to go" and provides a corresponding confidence score. Simultaneously, for verbs, the model further refines their semantics and usage by combining information such as their subject, object, and tense (obtained through grammatical analysis), such as determining the doer, receiver, and temporal state of the action.

[0061] In step S104, a text classification algorithm is used to perform topic domain analysis on the text information, and a key information is extracted using an information extraction algorithm. Based on the grammatical structure, lexical semantics, and the extracted key information, a language style judgment algorithm is used to determine the language style of the text, thereby constructing a complete contextual scene framework.

[0062] For topic classification: A topic classification model is constructed using a Naive Bayes-based text classification algorithm. First, a large amount of Korean text from different topic domains (such as daily life, business communication, culture and entertainment, academic research, and travel) is collected as training data. Each text is preprocessed, including removing stop words (such as common particles and conjunctions) and stemming (using Korean morphological analysis tools, such as the morphologist in KoNLPy). Then, a bag-of-words model is used to represent the text as a vector form of words, that is, counting the occurrence frequency of each word in the text to form a sparse vector. Through statistical analysis of the training data, the probability of each word appearing in different topics (i.e., prior probability) is calculated and used as parameters for the Naive Bayes model. For the text to be analyzed, the same preprocessing and bag-of-words model transformation are performed, and then the text is substituted into the Naive Bayes model. The probability of belonging to each topic domain is calculated according to Bayes' theorem. The topic with the highest probability is selected as the topic domain classification result of the text, thus determining the specific topic category to which the text belongs.

[0063] Bayes' theorem:

[0064]

[0065] In the Naive Bayes model, it is assumed that lexical features (or other features) are independent of each other (this is the "naive" assumption of Naive Bayes). Then, for a new text X (with feature vectors x1, x2, x3...xn), the probability of belonging to the topic domain Y can be calculated as follows:

[0066]

[0067] By calculating the probability that a text belongs to each topic domain, the topic domain with the highest probability is selected as the classification result of the text.

[0068] When constructing a topic classification model, the text classification algorithm employs feature selection and dimensionality reduction techniques (such as chi-square test and principal component analysis) to reduce the impact of noisy features on the classification results, thereby improving the model's classification accuracy and efficiency. Simultaneously, it combines deep learning's word vector pre-training technique, utilizing high-quality word vectors trained on a large-scale Korean corpus as feature inputs to enhance the model's ability to understand text semantics. This allows for more accurate determination of the text's topic domain (such as daily life, business communication, cultural entertainment, academic research, and travel), and the identification of some cross-domain text features, providing more precise topic information for contextual analysis.

[0069] For key information extraction, a rule-based and machine learning-based information extraction algorithm is used to extract key information from the text. For Named Entity Recognition (NER), a pre-trained Bi-LSTM+CRF model is employed. First, the Bi-LSTM+CRF model is trained using a large amount of Korean text with labeled named entities. The Bi-LSTM layer learns the contextual features of words in the text, while the CRF layer considers the constraints between the labels of named entities, thereby improving recognition accuracy. During the recognition process, words in the text to be analyzed are converted into word vectors and input into the model. The model outputs the named entity label corresponding to each word, such as person, place, organization, etc. For example, for a sentence... (My family went to Seoul for a trip last weekend.) The model was able to accurately identify... (Our family) refers to real people. (Seoul) is a location entity.

[0070] Time information is extracted using a time expression recognition algorithm based on regular expressions and a time keyword library. A database containing common Korean time keywords (such as...) is constructed. (last weekend) (today), (Tomorrow) etc.) and time format (e.g., "YYYY") MM DD (XXXX year XX month XX day), "HH MM A regular expression pattern library (e.g., "(XX hour XX minute)") is used to match and search text to extract time information. Combined with grammatical structure and lexical semantic analysis results, elements such as events and interpersonal relationships are determined, thereby constructing a complete contextual scene framework. For example, based on grammatical analysis, verbs and objects in a sentence are identified; combined with lexical semantics, actions and objects are clarified, thus determining the event as... (go) and (Travel) constructs a complete contextual scenario of a family trip to Seoul last weekend.

[0071] When determining language style, a decision tree-based language style judgment algorithm is used to classify the language style of texts based on grammatical structure characteristics (such as sentence complexity measured by the depth and number of nodes in the syntax tree, and sentence structure type determined by matching predefined sentence templates), vocabulary usage characteristics (such as the proportion of specialized vocabulary calculated by comparing with a specialized vocabulary database, and the frequency of colloquial vocabulary statistically analyzed using a colloquial vocabulary list), as well as the identified subject areas and key information. First, a large amount of Korean texts with different language styles (formal, colloquial, written, dialect, internet slang, etc.) are collected as training data. The aforementioned features are extracted as input attributes for the decision tree, and a decision tree model is constructed through training. For the text to be analyzed, its corresponding feature values ​​are calculated and substituted into the decision tree model. Starting from the root node, based on the comparison results of the feature values, the model searches downwards along different branches to finally determine the language style type of the text and extract the corresponding style feature indicators (such as lexical richness calculated by the ratio of the number of word types to the text length, average sentence length calculated by the ratio of the total sentence length to the number of sentences, and honorific frequency calculated by the ratio of the occurrence of honorific words and suffixes to the total number of words in the text) to provide learners with detailed hints about language style. The topic classification model and language style judgment algorithm continuously collect Korean text samples from different domains and styles, constantly retraining the model and adjusting parameters. Incremental learning algorithms, such as the AdaBoost algorithm based on ensemble learning combined with dynamic sample weighting technology, are used to automatically adjust the sample weights according to the importance and representativeness of new samples. This allows the model to pay more attention to important sample information, improve the classification accuracy and adaptability of various types of text, and reduce over-reliance on old samples, maintaining the model's sensitivity and learning ability to new language phenomena.

[0072] In step S105, based on the contextual scene framework, a contextual prompt generation algorithm is used to generate prompt information.

[0073] Based on the grammatical structure, lexical semantics, contextual information, and language style data obtained from the above steps, a contextual prompt generation algorithm based on template matching and Natural Language Generation (NLG) is used to generate detailed and targeted contextual prompts. For grammatical structure prompts, a series of templates are predefined, such as "This sentence is [sentence type name], the subject is [subject vocabulary], the predicate is [predicate vocabulary and form], its grammatical function is [detailed explanation], and this grammatical structure is frequently used in [common context examples]." When generating prompts, the corresponding fields in the templates are filled in according to the grammatical analysis results. For example, the sentence type name is filled with "declarative sentence" based on the judgment result, the subject vocabulary is filled with the specific subject word, the predicate vocabulary and form are filled with the predicate verb and its ending forms, the grammatical function is explained in detail according to grammatical rules, and common context examples are retrieved from the corpus as examples to be displayed to learners.

[0074] For vocabulary semantic prompts, the format is generated as follows: "[vocabulary] has a [specific meaning] in this sentence, and its common collocations include [list of common collocations and examples]. In other contexts, it can also represent [other meanings and examples]." The current meaning, common collocations, and other meanings of a word are obtained from the vocabulary semantic analysis results and filled in using example sentences from the corpus, enabling learners to clearly understand the multiple uses and semantic changes of a word.

[0075] For contextual descriptions, follow the format of "This sentence appears in the context of [thematic domain], and the scene described is [detailed contextual scene description], allowing learners to understand the usage situations of such sentences in real life." Based on the thematic domain extracted from the contextual information and the constructed contextual scene framework, describe in detail the situation in which the sentence is located, helping learners establish a connection between language and real-life scenarios.

[0076] For language style prompts, a template is generated stating, "This sentence belongs to [language style type], has [style feature description], and in similar [scenario examples], sentences of this style can be used to express [related content], helping learners master Korean language usage skills in different communication scenarios." Based on the language style judgment results, the characteristics and applicable scenarios of the language style are described, providing learners with guidance on language use.

[0077] For the presentation of output content, the output module presents the generated contextual prompts to learners in various formats. The grammar structure and key hints are displayed as pop-ups on the learning software interface, with interactive effects achieved using HTML, CSS, and JavaScript. HTML is used to construct the pop-up's structure and layout, CSS for styling, and JavaScript to display, hide, and interact with the user. For example, when a user clicks on a grammar tree node, a JavaScript event listener displays detailed grammar explanations.

[0078] Alternatively, the semantics and usage examples of words can be displayed as floating annotations, utilizing JavaScript's mouse event listening and dynamic HTML generation technology to show and hide the annotations. When the user hovers the mouse over a word, the JavaScript detects the event, dynamically generates and displays an annotation box containing the word's semantics and usage examples, providing the user with immediate word explanations.

[0079] Alternatively, the context can be described using a combination of text and images. By calling image libraries (such as pre-collected and organized image libraries related to different subject areas) and graphics drawing tools (such as Python's Matplotlib library), a schematic diagram of the relevant scene can be generated based on the context information, and key information such as people, places, and events can be labeled on the diagram, so that users can more intuitively feel the context of the sentence.

[0080] It also supports audio output, using speech synthesis APIs (such as Baidu Speech Synthesis, Google Cloud Speech Synthesis, etc.) to read important prompts aloud in clear and standard Korean pronunciation, meeting the needs of learners with different learning habits. Learners can select parameters such as speech rate and volume of the audio output on the software interface, and control the audio playback through the interaction interface with the speech synthesis API to obtain the best learning experience.

[0081] Examples illustrating the application of the above methods:

[0082] For example, for sentences (The students are studying hard in the classroom.) (Divided into...) Units such as [list of units]. Next, part-of-speech tagging (POS) is used to tag each unit with its part of speech. The noun is marked as a plural noun and is in the subject form. Marked as an adverbial of location, Marked as an adverb. By marking words as verbs and using honorifics, the text preprocessing is completed, providing a standardized data format for subsequent grammatical and semantic analysis.

[0083] The grammar analysis engine performs preliminary grammatical analysis on the preprocessed text based on sentence patterns and part-of-speech collocation rules in the Korean grammar rule base. For the sentence above, based on the grammatical structure of declarative sentences in the rule base, it uses particles... To indicate the plural form of the subject, Rules for indicating adverbs of place, identifying As the subject of the sentence, It is an adverbial of place. The verb is the predicate, and a simple grammar tree is initially constructed, in which... A branch of the root node of the tree. For another branch, The root node represents the predicate action.

[0084] Then, a statistical model trained on a large Korean corpus was used to evaluate and revise the preliminary grammatical analysis results. The statistical model optimized and judged some potentially ambiguous or uncommon grammatical structures based on the frequency and probability distribution of similar sentence patterns in the corpus. For example, for By analyzing the common positions and semantic association patterns of adverbs modifying verbs in a statistical model, the semantic and grammatical functions of this adverb in the sentence can be accurately determined. This further refines the syntax tree structure, confirms that the sentence is a declarative sentence, involves the present tense and honorific system, and uses an adverbial of place to describe the location where the action occurs.

[0085] For each word in the sentence, a query is performed in both the local Korean dictionary database and the online corpus. For example, for The dictionary database defines this word as "student," classifying it as a noun. Common collocations include... (students) Information such as "(good student)" was also found in online corpora. Examples of usage in different contexts, such as the specific semantics and collocations in school settings, educational discussions, and student activities.

[0086] Using a lexical semantic determination algorithm, combined with It functions as the subject in the sentence and is associated with the plural particle. Combining the concept of complex numbers with the context The information (of studying in a classroom) is used to determine its semantic meaning in the current context using a machine learning classification algorithm as "people who are engaged in learning activities in a classroom—students." For verbs... Based on its grammatical position and word endings Adverbs in context (effortfully) and adverbial of place (In the classroom), the semantics of the sentence are determined by the decision tree classification algorithm as "(students) are working hard to learn in the classroom". The sentence uses honorifics, which reflects a formal and polite tone. It is suitable for describing the scene of students learning at school and in formal written or oral communication.

[0087] By constructing a text classification model, the entire article is compared and analyzed against a pre-defined topic classification database. Since the article mainly revolves around school education and students' learning life, the model accurately determines that the text belongs to the "education and learning" topic domain based on training data such as the lexical features and grammatical structure features of a large number of educational texts.

[0088] Information extraction algorithms are used to extract key information from text, and named entity recognition algorithms are used to identify people. (Students) extracted location recognition algorithms. (Classroom), the time expression recognition algorithm failed to extract explicit time information (it can be assumed to be the present time based on the sentence tense), the event is... (Learning), thus constructing a complete contextual scenario: at present (the specific time is not explicitly mentioned, but is assumed to be now), students are engaged in learning activities in the classroom.

[0089] Based on the sentence's relatively standard grammatical structure and the use of a certain proportion of formal vocabulary (such as...), Based on the identified educational and learning themes, the language style judgment algorithm was used to determine that the language style of the text was formal written language and had the characteristics of an educational context. Language style feature indicators such as moderate average sentence length, formal and standard vocabulary, and high frequency of honorific endings were extracted to provide learners with more detailed language style descriptions and usage suggestions.

[0090] Based on the above analysis results, the following contextual prompt information was generated using a contextual prompt generation algorithm:

[0091] Grammatical structure: This sentence is a declarative sentence, with the subject being... Indicates "students" It is an adverbial of place, describing an action. The location where (learning) takes place. It is a verb. The honorific form of Korean is often used to formally describe someone performing an action in a certain place. It reflects the characteristic of Korean to express grammatical meaning and tone through particles and word endings. It is widely used in school education, formal written or oral communication, and other scenarios.

[0092] Lexical semantics: Meaning "student," it functions as the subject of the sentence, along with the plural particle. Combined with the concept of complex numbers; Combining context and word endings The phrase "(students) are studying diligently (in the classroom)" is a formal and polite expression, suitable for describing learning behavior in formal settings or when communicating with elders, superiors, etc.

[0093] Contextual description: This sentence appears in an educational context, possibly describing the daily learning state of students in school, meaning "students are studying hard in the classroom," allowing learners to understand the usage of such sentences in actual educational scenarios.

[0094] Language style: This sentence belongs to the formal written language style. The sentence structure is standard and complete, and it uses formal vocabulary and honorific endings. It has the characteristics of an educational setting. In similar scenarios such as school education, academic discussions, and formal reports, this style of sentence can be used to express relevant content accurately and politely. It helps learners master the language usage skills and stylistic characteristics of Korean in different communication scenarios.

[0095] Next, refer to the appendix. Figure 2 This invention describes a Korean context prompting device according to an embodiment of the present invention.

[0096] Figure 2 This is a block diagram of a Korean context prompting device according to an embodiment of the present invention.

[0097] like Figure 2 As shown, the Korean context prompting device includes:

[0098] The acquisition and preprocessing module 201 is used to acquire text information, convert it into a standard format using a character encoding conversion algorithm, segment the text by words and punctuation using a Korean character segmentation algorithm, and label each word with a part-of-speech tagging algorithm to generate formatted text data.

[0099] The grammar structure analysis module 202 is used to perform preliminary grammatical analysis on formatted text data and determine the main grammatical components based on a pre-built Korean grammar rule base. Then, a neural network-based dependency parsing algorithm is used to optimize the preliminary analysis results, determine the sentence structure and grammatical knowledge points, and construct a complete grammar tree structure.

[0100] The lexical semantic analysis module 203 is used to define the semantics of Korean words in text data. It queries the database and combines the grammatical position of Korean words in sentences, the grammatical and semantic relationships with adjacent words, and contextual information. It uses an attention-based neural network model to determine the specific semantics of Korean words in the current context.

[0101] The context information extraction module 204 is used to perform topic domain analysis on text data using text classification algorithms, extract key information through information extraction algorithms, and use language style judgment algorithms to judge the language style of the text based on grammatical structure, lexical semantics and extracted key information, thereby constructing a complete context scene framework.

[0102] The context prompt generation and output module 205 is used to generate prompt information based on the context scene framework and using a context prompt generation algorithm.

[0103] It should be noted that the foregoing explanation of an embodiment of a Korean context prompting method also applies to the Korean context prompting device of this embodiment, and will not be repeated here.

[0104] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. The electronic device may include:

[0105] The memory 401, the processor 402, and the computer program stored on the memory 401 and capable of running on the processor 402.

[0106] When the processor 402 executes the program, it implements a Korean contextual prompting method provided in the above embodiments.

[0107] Furthermore, electronic devices also include:

[0108] Communication interface 403 is used for communication between memory 401 and processor 402.

[0109] The memory 401 is used to store computer programs that can run on the processor 402.

[0110] The memory 401 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0111] If the memory 401, processor 402, and communication interface 403 are implemented independently, then the communication interface 403, memory 401, and processor 402 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0112] Optionally, in a specific implementation, if the memory 401, processor 402, and communication interface 403 are integrated on a single chip, then the memory 401, processor 402, and communication interface 403 can communicate with each other through an internal interface.

[0113] Processor 402 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0114] This invention also provides a computer program product, which, when executed by a processor, implements the above-described Korean contextual prompting method.

[0115] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described Korean contextual prompting method.

[0116] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0117] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0118] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0119] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0120] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0121] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.

[0122] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0123] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for providing contextual clues in Korean, characterized in that, Includes the following steps: The text information is obtained, converted into a standard format using a character encoding conversion algorithm, segmented into words and punctuation using a Korean character segmentation algorithm, and labeled with the part-of-speech tagging algorithm for each word to generate formatted text data. Based on a pre-built Korean grammar rule base, a rule-based grammar analysis algorithm is first used to perform preliminary grammar parsing on the formatted text data and determine the main grammar components. Then, a neural network-based dependency parsing algorithm is used to optimize the preliminary parsing results, determine the sentence structure and grammar knowledge points, and construct a complete syntax tree structure. Define the semantics of Korean words in text data, query the database, and combine the grammatical position of Korean words in sentences, the grammatical and semantic relationships with adjacent words, and contextual information. Use an attention-based neural network model to determine the specific semantics of Korean words in the current context. This paper utilizes text classification algorithms to perform topic domain analysis on text data, extracts key information through information extraction algorithms, and uses a language style judgment algorithm to determine the language style of the text based on grammatical structure, lexical semantics, and the extracted key information, thereby constructing a complete contextual scene framework. The text classification algorithm is based on the Naive Bayes algorithm, which determines the topic domain of Korean texts in different topic domains by performing feature extraction and probability calculation. The information extraction algorithm includes named entity recognition technology based on a pre-trained neural network model and a time expression recognition algorithm based on regular expressions and a time keyword library, used to extract key information about people, places, and times from the text. The language style judgment algorithm is based on decision trees or their ensemble learning improvement models, which determines the language style of the text by analyzing grammatical structure characteristics, lexical usage characteristics, topic domains, and key information, and extracts corresponding style feature indicators. The contextual prompt generation algorithm is based on template matching and natural language generation technology, which generates contextual prompt information by combining predefined prompt templates and rules with grammatical structure, lexical semantics, contextual information, and language style analysis results. Based on the contextual scenario framework, a contextual prompt generation algorithm is used to generate prompt information.

2. The Korean contextual prompting method according to claim 1, characterized in that: The standard format is UTF-8.

3. The Korean contextual prompting method according to claim 1, characterized in that: The part-of-speech tagging algorithm is a Hidden Markov Model (HMM) based algorithm that uses a semi-supervised learning method and is trained by combining a small amount of manually annotated Korean corpus with a large amount of unannotated corpus.

4. The Korean contextual prompting method according to claim 1, characterized in that: The Korean grammar rule base is constructed based on context-free grammar and stores Korean grammar rules in Backus paradigm. The rule-based grammar analysis algorithm uses a recursive approach to perform top-down or bottom-up grammar parsing on the text according to the grammar rules. The neural network-based dependency parsing algorithm uses a bidirectional recurrent neural network architecture to determine the dependency relationships between words by learning from a large amount of Korean corpus in order to optimize the syntax tree structure.

5. The Korean contextual prompting method according to claim 1, characterized in that: The database includes a Korean dictionary database and an online corpus.

6. The Korean contextual prompting method according to claim 1, characterized in that: The attention-based neural network model is based on the Transformer architecture and determines the semantics of words by learning the grammatical and semantic features of words as well as contextual information.

7. A Korean context prompting device, characterized in that, include: The acquisition and preprocessing module is used to acquire text information, convert it into a standard format using a character encoding conversion algorithm, segment the text by words and punctuation using a Korean character segmentation algorithm, and label each word with a part-of-speech tagging algorithm to generate formatted text data. The grammar structure analysis module is used to perform preliminary grammatical analysis on formatted text data and determine the main grammatical components based on a pre-built Korean grammar rule base. Then, a neural network-based dependency parsing algorithm is used to optimize the preliminary analysis results, determine the sentence structure and grammatical knowledge points, and construct a complete grammar tree structure. The lexical semantic analysis module is used to define the semantics of Korean words in text data. It queries the database and combines the grammatical position of Korean words in sentences, the grammatical and semantic relationships with adjacent words, and contextual information. It uses an attention-based neural network model to determine the specific semantics of Korean words in the current context. The context information extraction module is used to perform topic domain analysis on text data using text classification algorithms, extract key information through information extraction algorithms, and determine the language style of the text based on grammatical structure, lexical semantics, and the extracted key information, thereby constructing a complete contextual scene framework. The text classification algorithm is based on the Naive Bayes algorithm, which determines the topic domain of the text by extracting features and calculating probabilities from Korean texts in different topic domains. The information extraction algorithm includes named entity recognition technology based on a pre-trained neural network model and a time expression recognition algorithm based on regular expressions and a time keyword library, used to extract key information about people, places, and times from the text. The language style judgment algorithm is based on decision trees or its ensemble learning improved model, which determines the language style of the text by analyzing grammatical structure characteristics, lexical usage characteristics, topic domains, and key information, and extracts corresponding style feature indicators. The context prompt generation algorithm is based on template matching and natural language generation technology, which generates context prompt information by combining predefined prompt templates and rules with the results of grammatical structure, lexical semantics, contextual information, and language style analysis. The contextual prompt generation and output module is used to generate prompt information based on the contextual scene framework and using a contextual prompt generation algorithm.

8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, It stores a computer program thereon, the computer program being used to cause the computer to perform the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Context-based lexical analysis method and device and storage medium

    CN116992865A

  • Method and system for improving performance of vertical domain language model

    CN117312545A