Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubric Generator Expedition - Silicone Sages #110

Open
wants to merge 20 commits into
base: STAGING
Choose a base branch
from

Conversation

asleem
Copy link

@asleem asleem commented Oct 23, 2024

Summary

This Pull Request is for the Rubric Generator expedition, a new feature added to the Marvel-AI that allows educators to generate a customized rubric for an assignment based on the learning standard, point_scale and grade level specified. Moreover, educators can download the generated rubric as a pdf document.
In this PR we are using the extended file support (document loaders) that was created in epic 7.1 so educators can upload an assignment in a wide range of file type/format in order to generate the corresponding rubric.

Changes

  • Created new folder within app/features named rubric_generator that contains the following;
    • Core.py created the executor function that takes the input parameter and calls the create_rubric method
    • Metadata.json created the validation criteria for router.py to guaranty the parameter handling of rubric_generator_args
    • Tools.py created the RubricGenerator class with all necessary functions and classes for our rubric creation feature
    • Tests/test_core.py created 2 unit test with pytest
    • Prompt/rubric-generator-prompt.txt createdthe prompt sent to the LLM
    • document_loaders.py reused the document loader from epic 7.1 PR#79 Silicon Sages - Epic 7.1 - Multiple Choice Assessments Generator #79
  • Created RubricGeneratorArgs class defining the pydantic schema in app/services/schema.py
  • Created convert_rubric_generator_args_to_pydantic method in app/api/tool_utilities.py
  • Added “15” as the tool nb for the rubric generator feature in app/api/tools_config.json
  • Changed the output of submit_tool method to be able to return a downloadable pdf file instead of json response
  • Updated the requirements.txt file and added packages versions to fix dependencies conflict

Testing

RG terminal pytest

Results

The result is a downloadable pdf document that contain the rubric generated in a table template.
RG fastapi screenshot-
rubric.pdf

Notes

First, the LLM generates the rubric in JSON format. Next, we create a LaTeX document and insert the rubric into a table template. Finally, the LaTeX document is compiled into a PDF file.
The max number for the point scale is set to 8, the suggested value is 4 for optimal granularity in grading and to better fit in the generated rubric table template in the pdf document.
A feedback is added to the generated pdf document; this is an evaluation of the rubric created by the LLM for more assistance for the educators.

Request interface

Schema:
Screenshot 2024-10-23 at 2 25 59 PM

Example:

{
  "user": {
    "id": "string",
    "fullName": "string",
    "email": "string"
  },
  "type": "chat",
  "tool_data": {
    "tool_id": 15,
    "inputs": [
      {
        "name": "rubric_generator_args",
        "value": {
             "standard": "To make an ensemble Machine Learning model",
             "point_scale":8,
             "grade_level": "college",
             "file_type": "pdf",
             "lang": "en",
             "file_url": "https://raw.githubusercontent.com/asleem/uploaded_files/main/assignment_build_LM.pdf"
        }
      }
    ]
  }
}

Response interface

Schema:
Screenshot 2024-10-23 at 2 28 49 PM

Example:
rubric-47.pdf

@kyl88
Copy link

kyl88 commented Oct 24, 2024

Code implementation of the API and Schema looks solid :)

The hyperparameters were implemented well

It does match the criteria on PDF documents

Pytest test cases were implemented well

tool utilities and routing of app is good

@kyl88
Copy link

kyl88 commented Oct 24, 2024

@wilfredo

Any feedback from you with regard to Abir implementation and test cases

@AaronSosaRamos AaronSosaRamos added Rubric Generator For the Rubric Generator expedition type:enhancement For minor updates or changes that improve an existing feature or process. EXPEDITION This is an expedition that is currently being worked on in the Notion page: https://radicalxco.notio labels Nov 17, 2024
@AaronSosaRamos AaronSosaRamos linked an issue Nov 26, 2024 that may be closed by this pull request
34 tasks
@AaronSosaRamos
Copy link
Collaborator

@yunusj I've refactored the Rubric Generator moving the document loaders to a global utils folder for better reusability.

Copy link
Contributor

@yunusj yunusj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Response needs to be JSON instead of file download as our frontend displays the JSON in editable document viewer

@AaronSosaRamos
Copy link
Collaborator

Hey @yunusj, I've refactored the PR in order to return a JSON instead of a file download
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EXPEDITION This is an expedition that is currently being worked on in the Notion page: https://radicalxco.notio Rubric Generator For the Rubric Generator expedition type:enhancement For minor updates or changes that improve an existing feature or process.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] - Develop Rubric Generator
5 participants