Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions learnify/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
keys.py
__pycache__/
Binary file added learnify/Images/abstraction_levels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added learnify/Images/educai-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added learnify/Images/embedding.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added learnify/Images/hackatonai_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added learnify/Images/qa_chain_pipeline.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions learnify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Learnify

## Abstract

### We wrote a research paper about our approach [Research paper](data/LearnifyPaper-1.pdf)

### The pitch [Pitch](data/pitch.pdf)
The lack of personalization in education hampers struggling students’ ability to address learning gaps, contributing to burnout, high dropout
rates, and absenteeism. This issue arises from misguided approaches to personalization that focus on poor learning proxies, misdiagnosis of
causes-and-effects and an unhealthy emphasis on multi-modal course content, as current approaches to Intelligent Tutoring Systems (ITS)
often emphasize domain-specific expertise (e.g., math or coding), which neglects the core bottleneck in education:

1- lack of a good student
model

2- lack of a learning framework to utilize the student model.

Our solution addresses this by combining both elements: democratizing access to an accurate student model and applying Bloom Taxonomy as a
learning framework to utilize it. This contrarian approach personalizes the student profile rather than the domain, leveraging Bloom Taxonomy
to build student-centric ITS. Key to our innovation is delegating student-model expertise to large language models (LLMs) while leaving
domain expertise to students and teachers, thus ensuring both personalization and autonomy. This avoids issues like LLM hallucinations in
domain-specific contexts which can worsen student performance and enhances accuracy in student modeling. Unlike BloomBERT, Khanmigo,
and TahseenAI, which face limitations from narrow focuses or flawed assumptions about learning, our solution utilizes learning’s first principles
to efficiently exploit student models. By focusing on the foundational student model, we aim to address global educational challenges, including
those highlighted by Morocco’s low PISA ranking, and to extend EdTech beyond K-12 and language learning markets.

### Keywords
Bloom Taxonomy, Bloom’s 2 sigma problem, Mastery Learning, VARK model, Hypercorrection Effect, Cognitive Tutors, Intelligent Tutoring
System, Cognitivism, Connectivism, Large Language Models, Artificial Intelligence


## Instructions:

1. Create a new python environnement
2. Install requirements `pip install -r requirements.txt`
3. create a keys.py file inside `\src` folder and put your open-ai key in it `key = "sk-proj xxxxx ...."`
4. lunch the app with `streamlit run app.py`
5. Find examples in `data/biology` or `data/physics` as inputs to the system
Binary file added learnify/data/LearnifyPaper-1.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions learnify/data/biology/genetique_question.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Exercice 1 : Cellule et Structures Cellulaires

Qu'est-ce qu'une cellule eucaryote ? Donnez une définition concise.
Expliquez la différence entre le réticulum endoplasmique lisse et le réticulum endoplasmique rugueux avec un exemple pour chacun.
47 changes: 47 additions & 0 deletions learnify/data/biology/student_1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Remember

Question: List the main characteristics of a eukaryotic cell. Answer:

Defined nucleus enclosed by a nuclear envelope.
Presence of membrane-bound organelles like mitochondria and the endoplasmic reticulum.
Larger size compared to prokaryotic cells.
Complex cytoskeletal structure.

Understand

Question: Explain the difference between a eukaryotic cell and a prokaryotic cell. Answer:

Eukaryotic cells have a well-defined nucleus containing the cell’s DNA, whereas prokaryotic cells do not have a nucleus; their DNA floats freely in the cell.
Eukaryotes have complex organelles including mitochondria, whereas prokaryotes do not have membrane-bound organelles.


Apply

Question: How would you classify different types of cells based on their organelles? Answer:

Muscle Cells: Contain numerous mitochondria for energy during contraction.
Nerve Cells: Extensive network of smooth endoplasmic reticulum for neurotransmitter production.
Plant Cells: Have chloroplasts for photosynthesis and large vacuoles for storage.


Analyze

Question: Compare the structure of a plant cell and an animal cell. Answer:

Plant cells have a cell wall for structure and rigidity, animal cells do not.
Plant cells contain chloroplasts for photosynthesis, animal cells lack chloroplasts.
Animal cells have centrioles, which are typically absent in plant cells.

Evaluate

Question: Judge the importance of cell specialization in multicellular organisms. Answer:

Cell specialization allows multicellular organisms to be more efficient as different cells perform different functions, leading to higher overall functionality and survival.

Create

Question: Develop a model illustrating the functions of different organelles within a eukaryotic cell. Answer:

No response given. (Student 1 struggles with creation tasks.


39 changes: 39 additions & 0 deletions learnify/data/biology/student_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Original Question 1: Qu'est-ce qu'une cellule eucaryote ? Donnez une définition concise.
Remember

Question: List the main characteristics of a eukaryotic cell. Answer:

Nucleus containing DNA.
Membrane-bound organelles.
Larger and more complex than prokaryotes.

Understand

Question: Explain the difference between a eukaryotic cell and a prokaryotic cell. Answer:

Eukaryotic cells have a nucleus; prokaryotic cells do not.
Eukaryotic cells have organelles that prokaryotic cells lack.

Apply

Question: How would you classify different types of cells based on their organelles? Answer:

Could not accurately classify the types of cells.

Analyze

Question: Compare the structure of a plant cell and an animal cell. Answer:

Could not accurately describe the differences, only noted that plant cells have chloroplasts and animal cells do not.

Evaluate

Question: Judge the importance of cell specialization in multicellular organisms. Answer:

Gave a vague answer, noting only that specialization "might be useful" without providing substantial reasoning or examples.

Create

Question: Develop a model illustrating the functions of different organelles within a eukaryotic cell. Answer:

No response given. (Student 2 also struggles with creative tasks.)
9 changes: 9 additions & 0 deletions learnify/data/physics/exo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Exercice 1 : Définition et Types d'Ondes

Qu'est-ce qu'une onde mécanique ? Donnez une définition concise.
Expliquez la différence entre une onde transversale et une onde longitudinale avec un exemple pour chacune.

Exercice 2 : Propagation et Vitesse

Comment la vitesse de propagation d'une onde est-elle définie dans un milieu ? Utilisez la formule donnée dans vos notes.
Quel effet l’élasticité d’un milieu a-t-elle sur la vitesse de propagation d’une onde ? Donnez un exemple.
Binary file added learnify/data/pitch.pdf
Binary file not shown.
9 changes: 9 additions & 0 deletions learnify/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tiktoken==0.4.0
openai==0.27.8
langchain==0.0.247
chromadb==0.4.3
fastapi==0.99.1
uvicorn==0.23.1
streamlit
fpdf
matplotlib
150 changes: 150 additions & 0 deletions learnify/src/agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# agents.py

# Bloom Taxonomy Creator Agent Prompt
TAXONOMY_AGENT_PROMPT = """
You are an educational design assistant specializing in Bloom's Taxonomy. Your task is to transform a set of input questions into questions aligned with each level of Bloom's Taxonomy: Remember, Understand, Apply, Analyze, Evaluate, and Create.

For each input question, generate corresponding questions at each taxonomy level, ensuring they are relevant to the original question's topic.

Your output **must** be a well-formatted JSON object **only**. Do not include any explanations, code blocks, or additional text. The JSON should have a single key "Topic Questions" mapping to an array of question objects. Each question object must include the following keys:

- "Original Question"
- "Remember"
- "Understand"
- "Apply"
- "Analyze"
- "Evaluate"
- "Create"

Ensure the JSON is valid and free from any formatting issues.

**Example Output:**

{
"Topic Questions": [
{
"Original Question": "What is photosynthesis?",
"Remember": "Define photosynthesis.",
"Understand": "Explain how photosynthesis works.",
"Apply": "Describe how photosynthesis affects plant growth.",
"Analyze": "Compare photosynthesis and cellular respiration.",
"Evaluate": "Assess the importance of photosynthesis in ecosystems.",
"Create": "Design an experiment to measure the rate of photosynthesis."
}
]
}

**Input Questions:**

{{context}}
"""

# Scoring Agent Prompt
SCORING_AGENT_PROMPT = """
You are an educational evaluator specializing in Bloom's Taxonomy assessments.

Given the following JSON data containing students' answers to questions at each level of Bloom's Taxonomy, evaluate each answer and assign a score.

Each score should be between 0 and 5, where 0 indicates no understanding and 5 indicates excellent understanding.

Add a new field called "score" to each Sub-Question.

Ensure the output is valid JSON and follows the same structure as the input, but with the "score" field added to each Sub-Question.

**Example Input:**

{
"Bloom Taxonomy": {
"Remember": [
{
"Original Question": "What is photosynthesis?",
"Sub-Question": {
"Question": "Define photosynthesis.",
"Answer": "It's how plants make food."
}
}
]
}
}

**Example Output:**

{
"Bloom Taxonomy": {
"Remember": [
{
"Original Question": "What is photosynthesis?",
"Sub-Question": {
"Question": "Define photosynthesis.",
"Answer": "It's how plants make food.",
"score": 4
}
}
]
}
}

**Input JSON:**

{input_json}
"""

# Metacognitive Recommendation Agent Prompt for Teacher
METACOGNITION_AGENT_PROMPT_TEACHER = """
You are an educational coach specializing in metacognitive strategies aligned with Bloom's Taxonomy, addressing teachers.

Given the following JSON data containing the weighted average scores for each level of Bloom's Taxonomy, analyze the scores and recommend metacognitive strategies that the teacher can use to help the student improve in all areas.

Prioritize the Bloom's Taxonomy levels with the lowest weighted average scores, using the Leitner system to address and emphasize these areas. However, also provide encouraging feedback and suggestions for the areas where the student is performing well, guiding the teacher on how to support the student's strengths.

For each taxonomy level:

- Summarize the student's current performance.
- Provide metacognitive strategies and scaffolding techniques that the teacher can implement to help the student enhance their learning in that area.

Ensure the output is a well-structured, clear set of recommendations without any additional explanations or irrelevant content.

**Input JSON:**

{input_json}
"""

METACOGNITION_AGENT_PROMPT = """
You are an educational coach specializing in metacognitive strategies aligned with Bloom's Taxonomy, addressing teachers.

Given the following data containing the scores for each subquestion and taxonomy level, analyze the scores and recommend metacognitive strategies that the teacher can use to help the student improve in all areas.

For each taxonomy level:

- Summarize the student's current performance.
- Provide metacognitive strategies and scaffolding techniques that the teacher can implement to help the student enhance their learning in that area.

Ensure the output is a well-structured, clear set of recommendations without any additional explanations or irrelevant content.

**Input Data:**

{input_json}
"""

# Metacognitive Recommendation Agent Prompt for Student
METACOGNITION_AGENT_PROMPT_STUDENT = """
You are an educational coach specializing in metacognitive strategies aligned with Bloom's Taxonomy, addressing students.

Given the following JSON data containing the weighted average scores for each level of Bloom's Taxonomy, analyze the scores and provide metacognitive strategies to help the student improve in all areas.

Prioritize the Bloom's Taxonomy levels with the lowest weighted average scores, using the Leitner system to address and emphasize these areas. However, also provide encouraging feedback and suggestions for the areas where you are performing well, motivating you to continue your great work and strive for even better understanding.

For each taxonomy level:

- Acknowledge your current performance with positive and motivating language.
- Provide first-principles-based metacognitive strategies that you can use to enhance your learning in that area.

Ensure the output is friendly, motivational, and free from technical jargon.

**Input JSON:**

{input_json}
"""

# Threshold for generating recommendations
THRESHOLD = 3.0 # Adjust this value as needed
Loading