Location>code7788 >text

New Concept English Learning Helper's Full Deconstruction Tutorials

Popularity:381 ℃/2024-10-28 09:53:01

Today we will realize an intelligent assistant for learning English. Thinking back to your English learning experience as a child, I wonder what extracurricular English textbooks you have used. For me, the one I was most often exposed to in my English cram class as a child was New Concept English.

Therefore, we have decided to utilize the New Concept English textbook directly to build a small English learning assistant just for you. This assistant will quickly help you consolidate your English fundamentals, especially for elementary and middle school students, and help them excel in the midterm exams!

clear-cut

Well, the goal of our assistant is very clear, which is to help users who are learning English, especially those learners who have a low foundation or want to master the fundamentals of English in a short period of time. For this purpose, we will focus on Book 1 of New Concept English as it is a solid foundation for learning English. This book covers the basic knowledge of phonetics, intonation, grammar, lexicon, syntax and sentence structure, which is the key to building a good foundation in English and stepping into the English-speaking world.

It is important to note that the curriculum in Book I is designed to center on odd-numbered lessons (e.g., 1-001), while the corresponding even-numbered lessons (e.g., 1-002) complement the content of the previous lesson. Therefore, we will focus mainly on the odd-numbered lessons to ensure systematic and coherent learning. This will provide learners with a solid foundation to help them further along their English learning journey.

Start building

When asking questions directly, the model may not be able to give accurate answers because it has not been trained on specific data, as shown in the figure below. Therefore, to solve this problem, we need to mount the knowledge base or database with the model in order to provide more accurate and comprehensive answers to the users.

In the subsequent explanation, we will detail how to effectively integrate these resources to enhance the answering ability and user experience of the intelligent assistant.

image

Character Commands

In order to avoid the redundancy of information, I decided not to share the intermediate coupling process, but rather provide a final version directly to you for easy reference. Hopefully this will convey the core content more efficiently.

# Role .
You are a New Concept Book 1 English learning teacher who is familiar with the knowledge points of Book 1 English. You will test users' English questioning skills using Chinese quizzes and provide detailed feedback.

## Background .
New Concept English Book 1 is a basic introductory course for English learners. It is especially suitable for learners who have a weak foundation in English and want to build a solid English foundation in a short period of time.

## Goals .
1. Call the [data_sheet_agent] tool to get the English points of the course. 2.
2. Help learners acquire basic English knowledge through four questions. 3.
3. Generate personalized review materials and study suggestions at the end of the four questions.

## Constrains.
1. prohibit asking questions for even numbered lessons such as Lesson 2, must ask questions for odd numbered lessons such as Lesson 1 and reply directly to the user.
2. a minimum of 4 practice questions must be scheduled to ensure a more accurate assessment of learning.
3. it is forbidden to ask questions that exceed the range of English words and phrases in the current lesson. It is prohibited to prompt the user for answers
4. it is forbidden to ask four questions at once, they must be provided one by one
5. Questions must be asked in a combination of English and Chinese. It is prohibited to ask translation questions.

## Skills : 1.
1. Excellent knowledge of English grammar and vocabulary. 2.
2. Ability to design and organize at least 4 practice questions for language practice. 3.
3. Strong logical thinking skills. 4.
4. Understand the psychology and needs of English learners. 5.
5. Ability to utilize a variety of teaching methods to enhance learning.

## Workflows:
0. use the memory_variable_writer tool to update the value of the course memory variable according to the course selected by the user so that subsequent questions and feedback can be specific to that lesson.
1. call the [data_sheet_agent] tool with the parameter [New Conceptual English - Book 1 - Lesson XXX] to query the English content of the selected course and identify the key knowledge points. with XXX denoting a three-digit number: 001/005 and so on.
2. Introduce the learning objectives and key knowledge points of the current course. Introduce examples:
The first lesson in Book 1 of New Concept English is "Excuse me!". The learning objective of this lesson is to master some basic daily phrases. Key knowledge points include the usage of expressions such as "excuse me", "yes" and "is this".
3. strictly follow the content of the original sentences, phrases and words of the course to determine what is to be asked this time and start the first round of questions, aiming to test students' basic understanding of the course content.
4. asking only one question at a time and keeping track of the current number of questions.
5. the user must answer the question by writing an English sentence in order to move on to the next question. four questions must be provided one by one and it is forbidden to ask more than four questions.
6. the GaiJinYiJianHeXueXiJianYi tool must be used to generate a certificate of honor for the user after the four practice questions have been asked.

Here, I would like to elaborate on our debugging idea. The ultimate goal of this instruction is to have the big model, after retrieving information from the database for the first time, perform four rounds of Q&A in sequence based on the first data retrieval. At the end of these four rounds of Q&A, the model will also generate a summary and recommendations for you to better organize and apply what you have learned.

In addition, in order to motivate the students, we have designed a Certificate of Merit to recognize their efforts and achievements. We have also provided some relevant video links for further study and reference. We hope this series of designs will be helpful to you!

variant

First, let's start with the concept of variables and work our way deeper into understanding their importance. The reason why variables are introduced here is that the current course section must be set up at the time of the first question. If this section is not handled properly, then it will be difficult to function in the subsequent generation of certificates, even if the prompts clearly indicate which parameters need to be passed.

Therefore, the main purpose of this variable is to log the relevant information for subsequent use. In subsequent steps of the workflow, we can call this variable, thus ensuring that the content of the generated certificate is accurate.

image

default value

Of course, I set I set a default value for this variable, which is mainly used for judgment in the workflow. This mechanism can effectively prevent users from randomly requesting large models to invoke the workflow to generate certificates in the chat window, thus avoiding the misuse of the function.

Although I initially considered setting these limits in the cue word, the larger model doesn't always follow these directives, so a design that relies on workflow is more reliable.

single session

Moreover, this mechanism is designed for a single session, because each time the user may question about a different course. In this way, we can effectively avoid generating wrong certificates. Therefore, instead of keeping the variable in effect all the time, I adjusted it according to the specific business requirements.

Mounting the database

Next, we need to start searching for relevant data to mount Next, we need to start searching for relevant data to mount Next, we need to start searching for relevant data to mount Next, we need to start searching for relevant data to mount Next, we need to start searching for relevant data to mount.

web plug-in

First, I want to make it clear that here I am not using a web plugin or setting up a web node in the workflow for direct URL access for a couple of reasons.

First of all, the stability of websites is often unpredictable, and direct access may cause the assistant's functionality to fail, thus affecting the user experience.

Second, I took a closer look at the other site and realized that they didn't have a clear protocol for crawling, and that a hasty data crawl might burden the site or even lead to a crash.

In order to ensure the stability of the system and the normal operation of the other side's website, I chose a more secure way to handle the data.

Data Cleaning

Next, we will begin the process of data cleaning. Data on web pages often contains a lot of impurities and redundant information, and these unwanted elements may negatively affect the quality of the model's responses.

I used a relatively simple and inexpensive method to accomplish my needs by resorting to a third-party Kimi web tool. All I had to do was write the appropriate prompts to get the data I needed. The process took about two hours of my time. Of course, if you have the financial backing, you can consider interfacing directly through code. This way, using the loop structure in the code, you can stitch the data together more efficiently, saving time and effort.

image

Creating a database

Here, my choice to use a database rather than a knowledge base may raise some questions. In most people's perceptions, we usually think that data should be stored in knowledge bases, due to the fact that knowledge bases are often seen as the ideal place for knowledge management and information retrieval. However, in reality, there are several reasons for using databases that are worth exploring in depth.

First of all, the problem of hit rate is not negligible. Knowledge bases may be subject to certain limitations when querying, which may lead to a relatively low hit rate for information retrieval. In other words, we may face difficulties in accessing information.

Second, even if the desired information is hit, the knowledge base query process often leads to additional token consumption. Let's look at the effect, as shown in the figure:

image

The reason we need to use the database for precision matching is because our questions directed to a particular course are very specific and targeted.

As for why we don't use mnemonics, the reason is that mnemonics are mainly for data generated during conversations, and the nature and structure of these data don't exactly match our needs.

Let's further analyze how the database behaves. First, we need to create the database locally and make sure that we have written the corresponding CSV file. Before proceeding with the import, it is recommended to open this CSV file and double-check that its format and content are correct. This step is crucial because if the file format does not meet the requirements or if there are problems with the content, the import may result in no data being displayed in the database, as shown in the figure:

image

As soon as the loading is complete, we will proceed with the mount operation.

image

Next, we will test the effect in the conversation to verify the successful realization of accurate matching. This process not only effectively saves token consumption, but also significantly improves the accuracy of responses.

image

During the debugging process, I noticed that certain elements were not necessary, such as the translation of the original text. To further improve the quality and validity of the data, I performed a second data cleaning. This process allowed me to filter out information that was more relevant to the project goals, thus ensuring the accuracy and usefulness of the final dataset.

After this round of cleaning, the final data obtained is as follows:

image

After a series of tests, I found that the system was performing close to what I expected it to do, and was already quite good at normal question answering in particular. In addition, when I encountered uncertainty, the system was able to provide timely and appropriate hints to help me better construct my answers.

image

workflow component

At this stage, we had a clear understanding of the purpose of the workflow, as the tasks to be accomplished were relatively complex, and cue words and reflection alone could not effectively achieve all the goals. Therefore, creating a fully functional workflow is especially necessary. Next, let's take a closer look at what core functionality a workflow needs to have:

  1. Certificate Generation: This feature aims to encourage students to develop good study habits and motivate them to continue by generating certificates to recognize their efforts and achievements.
  2. Summary of effects and recommendations: The workflow needs to be able to summarize the current user's performance on the test quiz and provide sound feedback and suggestions for improvement. This feature will help students identify their strengths and weaknesses so that they can be more focused.
  3. Video Link Recommendation: To complement the current learning chapter, the workflow should also provide links to relevant videos for students to watch on their own. This not only enriches the learning resources, but also increases the flexibility and interactivity of learning.
  4. Request limitations: In order to ensure appropriate use of the system, the workflow needs to prohibit users from directly requesting the generation of certificates without testing. This restriction will encourage students to engage seriously in the learning process, rather than relying on the quick acquisition of certificates.

The implementation of other functions is relatively simple, for example, the part of suggestions and summaries will be done by a large model node which is able to comprehensively analyze the user's performance and generate targeted feedback. As for the provision of video links, they will be generated by the Baidu Video node.

Special attention needs to be paid here: In order to prevent video links from being generated blindly, my variable settings include detailed formatting requirements. The format must be "New Conceptual English - Book 1 - Lesson xxxxx". Using just "Lesson 1" or just the name of the lesson may result in unrelated video links being searched.

Here, I'll talk in detail about the process of certificate generation.

Generating Certificates

Here, I used a third-party API that involves some other cloud vendors, so I won't go into this part in depth. In short, this honor certificate generation process actually combines a cloud vendor's edge computing capabilities and CDN services with image processing to achieve dynamic generation. For the docking code, you can refer to what I shared, in which I removed the secret key information to ensure privacy and security.

# Define a main function, passing in the params parameter. params contains the input variables for the node configuration.
# Need to define a dictionary as an output variable
# Reference the node-defined variables: params['variable name']
# Runtime environment Python3; pre-built Package: NumPy
import json
import hashlib
from datetime import datetime
import re


def encode_chinese_in_url(url): encoded_url = "
    encoded_url = ""

    for char in url.
        if char == ' '.
            encoded_url += '%20' # encode spaces as %20
        elif '\u4e00' <= char <= '\u9fff': # Unicode range for Chinese characters
            encoded_char = ('utf-8')
            encoded_url += ''.join(['%' + format(b, '02X') for b in encoded_char])
        else.
            encoded_url += char # other characters remain unchanged

    return encoded_url

def get_final_url(template_id,params).
    # URL prefix
    url_prefix = ''
    # The format of the image set in the template
    format = 'png'
    # User Id
    user_id = ''
    # Template Id
    # template_id = template_id
    # API Key for signature generation
    api_key = ''
    # Fill in the parameters of the template to be modified here
    # params = {}

    # Sort the parameter keys
    sorted_keys = sorted(())
    # Splice the parameters
    search_params = '&'.join(f'{key}={params[key]}' for key in sorted_keys)

    # Data to be signed
    sign_data = ({
        'apiKey': api_key,
        'searchParams': search_params,
    }, ensure_ascii=False,separators=(","", ":"))
    # return sign_data
    # Call md5 to generate the signature
    sign = generate_md5(sign_data)

    # Stitch together the final path
    final_url = f"{url_prefix}/{sign}/{user_id}/{template_id}. {format}? {search_params}"

    encoded_path = encode_chinese_in_url(final_url)
    return encoded_path

def generate_md5(sign_data).
    # Create an MD5 hash object
    md5_hash = hashlib.md5()
    # Update the hash
    md5_hash.update(sign_data.encode(encoding='UTF-8'))
    # Get the hexadecimal hash
    return md5_hash.hexdigest()

def main(params).
    curse = params['curse']
    # Get the current date
    current_date = ()

    # Format the date
    formatted_date = current_date.strftime('%Y-%m-%d')
    template_id = 'ep-vna6OlJNvSwu'
    params = {
        "name": f"{curse}",
        "title": f "Congratulations little buddy for completing your English studies in a positive way! To encourage you to keep up the good work, we're issuing this certificate as a token of our appreciation",
        "date": f"{formatted_date}",
        "award": f "New Concept English Learning Assistant"
        }
    final_url = get_final_url(template_id,params)
    # Create a dictionary as an output variable
    output_object = {

        # Reference the city variable defined by the node
        "link": final_url, # create a dictionary as an output variable
    }

    # Return the output dictionary type variable output_object, containing the output data required by the code node
    return output_object

The final result is excellent, the details can be referred to as shown in the picture below:

image

overall layout

Let's take a closer look at the design and structure of the overall layout.

image

Note that there is a key code node before the end node. This node is responsible for determining what should be output. Checking out the code snippet below will give you a clearer understanding of this logic and will help you better integrate the whole process.

image

Here, we splice the output directly, which ensures that the outer large model does not embellish or modify the output. This practice helps maintain the integrity of the original information. We have already touched on this issue in previous discussions, so we will not go into detail here.

image

overall effect

Programming effects

Let's check out the choreography first. There aren't too many unnecessary components configured here, other than what I mentioned before.

image

Q&A effect

Overall quizzing is sometimes subject to errors in judgment, resulting in an inability to accurately identify completed answer rounds. As a result, there may occasionally be a missing Q&A round. However, this does not affect the proper functioning of the overall process. The system is still able to run smoothly without serious problems.

image

I hope this build process will provide substantial help and inspiration~

summarize

In today's sharing, we discussed how to build an intelligent English learning assistant that utilizes the first book of New Concept English as a foundation to help students build a solid foundation in English learning. Recalling our goal, especially for primary and junior high school students, this assistant is designed to quickly and effectively improve their English proficiency, especially in important exams like the midterm exams, to help them excel.

We have clarified the core objective of Learning Assistants: to enable learners to progressively master basic English through systematic learning and interaction, focusing particularly on the knowledge points of odd-numbered lessons. This targeted approach to learning allows students to build confidence in a short period of time while effectively avoiding redundancy and confusion in their studies. By asking questions and giving feedback one by one, students are able to better understand and apply what they have learned, enhancing their language skills.

Next, we elaborate on how to optimize the model's answering capabilities by integrating the knowledge base and database. By accurately matching course content, the learning assistant is able to provide accurate answers and learning suggestions in real time, thus enhancing the user experience. Meanwhile, certificate generation and personalized feedback are designed to motivate students to make continuous progress and foster their enthusiasm for learning.

The project not only focuses on the scientific and systematic nature of the learning process, but also pays more attention to the experience and feelings of the learners. During the debugging and optimization process, continuous reflection and improvement are made to ensure that the final learning assistant can meet the needs of a wide range of students. Through such exploration and practice, we expect every student to receive better support and guidance in their English learning journey.


I'm Rain, a Java server-side coder, studying the mysteries of AI technology. I love technical communication and sharing, and I am passionate about open source community. I am also a Tencent Cloud Creative Star, Ali Cloud Expert Blogger, Huawei Cloud Enjoyment Expert, and Nuggets Excellent Author.

💡 I won't be shy about sharing my personal explorations and experiences on the path of technology, in the hope that I can bring some inspiration and help to your learning and growth.

🌟 Welcome to the effortless drizzle! 🌟