Saturday

AI Assistant For Test Assignment

 

Photo by Google DeepMind

Creating an AI application to assist school teachers with testing assignments and result analysis can greatly benefit teachers and students. Here's an overview of why such an application would be beneficial and how it can be developed cost-effectively:

Grading assignments for all students is time-consuming for teachers. AI can automate this process for certain types of assessments, freeing up teachers' time for more interactive learning experiences.


Let's see how it can help our teachers.

1. Teacher Workload: Primary school teachers often have a heavy workload, including preparing and grading assignments for multiple subjects and students. Automating some of these tasks can significantly reduce their workload.

2. Personalized Learning: AI-based applications can provide personalized feedback to students, helping them understand their strengths and weaknesses, leading to more effective learning outcomes.

3. Efficiency: By automating tasks like grading and analysis, teachers can focus more on teaching and providing individualized support to students.


Key Features of the Application:

1. Assignment Creation: Teachers can create assignments for various subjects easily within the application, including multiple-choice questions, short-answer questions, and essay-type questions.

2. OCR Integration: Integration with Azure OCR services allows teachers to scan and digitize handwritten test papers quickly, saving time and effort.

3. AI-Powered Grading: Utilize OpenAI's ChatGPT for grading essay-type questions and providing feedback. Implement algorithms for grading multiple-choice and short-answer questions.

4. Result Analysis: Generate detailed reports and analytics on student performance, including overall scores, subject-wise performance, and areas of improvement.

5. Personalized Feedback: Provide personalized feedback to students based on their performance, highlighting strengths and areas for improvement.

6. Accessibility: Ensure the application is user-friendly and accessible to teachers with varying levels of technical expertise.


Development Approach:

1. Prototype Development: Start with a small-scale prototype to validate the concept and gather feedback from teachers and students.

2. Iterative Development: Adopt an iterative development approach, gradually adding features and refining the application based on user feedback.

3. Cloud-Based Architecture: Utilize cloud-based services for scalability and cost-effectiveness. For example, deploy the application on platforms like Azure or AWS, leveraging serverless computing and managed services.

4. Open Source Libraries: Utilize open-source libraries and frameworks to minimize development costs and accelerate development, such as Flask for the backend, React for the frontend, and TensorFlow for machine learning tasks.

5. Data Security and Privacy: Ensure compliance with data security and privacy regulations, especially when handling student data. Implement encryption, access controls, and data anonymization techniques as needed.

6. User Training and Support: Provide comprehensive user training and ongoing support to teachers to ensure they can effectively use the application.

By following these guidelines, you can develop a cost-effective AI application that enhances the teaching and learning experience for primary school teachers and students.


Here is a Python script to find out how much it costs to use the OpenAI tool for the application above.


def calculate_cost(params):

    """

    Calculates the cost for using ChatGPT for a dynamic assignment application in a school.


    Parameters:

    params (dict): A dictionary containing parameters for the cost calculation.


    Returns:

    float: The total cost of the assignment application.


    Explanation:

    - Extract parameters from the input dictionary.

    - Calculate the number of tokens based on the number of words (assuming 750 words per 1000 tokens).

    - Define costs for different models, fine-tuning, and embedding.

    - Determine the model to be used, considering fine-tuning and embedding.

    - Calculate the cost based on the chosen model, fine-tuning, embedding, number of students, and assignment subjects.

    - Return the total cost.

    """

    words = params["words"]

    tokens = words * 1.25  # Assuming 750 words per 1000 tokens

    model = params["model"]  # Which model to use

    fine_tuning = params["fine_tuning"]  # Fine-tuning required or not

    embed_model = params["embed_model"]  # For embedding model

    students = params["students"]

    assignment_sub_count = params["assignment_sub_count"]


    # Costs for different models

    models = {

        "gpt4": {"8k": 0.03, "32k": 0.06},

        "chatgpt": {"8k": 0.002, "32k": 0.002},

        "instructgpt": {

            "8k": {"ada": 0.0004, "babbage": 0.0005, "curie": 0.0020, "davinci": 0.0200},

            "32k": {"ada": 0.0004, "babbage": 0.0005, "curie": 0.0020, "davinci": 0.0200},

        },

    }


    # Fine-tuning costs

    fine_tuning_cost = {

        "ada": {"training": 0.0004, "usage": 0.0016},

        "babbage": {"training": 0.0006, "usage": 0.0024},

        "curie": {"training": 0.0030, "usage": 0.0120},

        "davinci": {"training": 0.0300, "usage": 0.120},

    }


    # Embedding model costs

    embedding_model = {"ada": 0.0004, "babbage": 0.005, "curie": 0.020, "davinci": 0.20}


    total_cost = 0.0


    instructgpt_models = ["ada", "babbage", "curie", "davinci"]

    if model in instructgpt_models:

        sub_model = model

        model = "instructgpt"


    if model == "instructgpt":

        if tokens > 32000:

            price_model = models[model]["32k"].get(sub_model, {})

        else:

            price_model = models[model]["8k"].get(sub_model, {})

    else:

        if tokens > 32000:

            price_model = models[model]["32k"]

        else:

            price_model = models[model]["8k"]


    if fine_tuning:

        total_cost += (tokens * fine_tuning_cost[sub_model]["training"]) + (

            tokens * fine_tuning_cost[sub_model]["usage"]

        )


    if embed_model:

        total_cost += tokens * embedding_model[sub_model]


    total_cost += price_model * students * assignment_sub_count


    return total_cost



params = {

    "words": 10000,

    "model": "ada",

    "fine_tuning": True,

    "embed_model": "ada",

    "students": 200,

    "assignment_sub_count": 8,

}


print(params)


cost = calculate_cost(params)

print(

    f"The total cost of using ChatGPT for an assignment application with {params['students']} students and {params['assignment_sub_count']} subjects is: ${cost:.2f}"

)

 

Some useful links from Azure

https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/quickstarts-sdk/client-library?tabs=linux%2Cvisual-studio&pivots=programming-language-python

https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/concept-ocr

https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/quickstarts-sdk/image-analysis-client-library-40?tabs=visual-studio%2Clinux&pivots=programming-language-python

https://microsoft.github.io/PartnerResources/skilling/ai-ml-academy/openai

https://azure.microsoft.com/en-us/products/ai-services/ai-document-intelligence

No comments:

Incremental Data Loading from Databases for ETL

  pexel Let first discuss what is incremental loading into the data warehouse by ETL from different data sources including databases. Increm...