Updated this to the latest version of develop, got rid of most of the duplication, might be missing some packages in toml, needs testing
This commit is contained in:
@@ -2,7 +2,7 @@ from enum import Enum
|
||||
|
||||
BLACKLISTED_WORDS = ["jesus", "sex", "gay", "lesbian", "homosexual", "god", "angel", "pornography", "beer", "wine",
|
||||
"cocaine", "alcohol", "nudity", "lgbt", "casino", "gambling", "catholicism",
|
||||
"discrimination", "politics", "politic", "christianity", "islam", "christian", "christians",
|
||||
"discrimination", "politic", "christianity", "islam", "christian", "christians",
|
||||
"jews", "jew", "discrimination", "discriminatory"]
|
||||
|
||||
|
||||
@@ -11,6 +11,26 @@ class ExamVariant(Enum):
|
||||
PARTIAL = "partial"
|
||||
|
||||
|
||||
class CustomLevelExerciseTypes(Enum):
|
||||
MULTIPLE_CHOICE_4 = "multiple_choice_4"
|
||||
MULTIPLE_CHOICE_BLANK_SPACE = "multiple_choice_blank_space"
|
||||
MULTIPLE_CHOICE_UNDERLINED = "multiple_choice_underlined"
|
||||
BLANK_SPACE_TEXT = "blank_space_text"
|
||||
READING_PASSAGE_UTAS = "reading_passage_utas"
|
||||
WRITING_LETTER = "writing_letter"
|
||||
WRITING_2 = "writing_2"
|
||||
SPEAKING_1 = "speaking_1"
|
||||
SPEAKING_2 = "speaking_2"
|
||||
SPEAKING_3 = "speaking_3"
|
||||
READING_1 = "reading_1"
|
||||
READING_2 = "reading_2"
|
||||
READING_3 = "reading_3"
|
||||
LISTENING_1 = "listening_1"
|
||||
LISTENING_2 = "listening_2"
|
||||
LISTENING_3 = "listening_3"
|
||||
LISTENING_4 = "listening_4"
|
||||
|
||||
|
||||
class QuestionType(Enum):
|
||||
LISTENING_SECTION_1 = "Listening Section 1"
|
||||
LISTENING_SECTION_2 = "Listening Section 2"
|
||||
@@ -63,7 +83,14 @@ class FieldsAndExercises:
|
||||
GEN_TEXT_FIELDS = ['title']
|
||||
LISTENING_GEN_FIELDS = ['transcript', 'exercise']
|
||||
READING_EXERCISE_TYPES = ['fillBlanks', 'writeBlanks', 'trueFalse', 'paragraphMatch']
|
||||
READING_3_EXERCISE_TYPES = ['fillBlanks', 'writeBlanks', 'trueFalse', 'paragraphMatch', 'ideaMatch']
|
||||
|
||||
LISTENING_EXERCISE_TYPES = ['multipleChoice', 'writeBlanksQuestions', 'writeBlanksFill', 'writeBlanksForm']
|
||||
LISTENING_1_EXERCISE_TYPES = ['multipleChoice', 'writeBlanksQuestions', 'writeBlanksFill', 'writeBlanksFill',
|
||||
'writeBlanksForm', 'writeBlanksForm', 'writeBlanksForm', 'writeBlanksForm']
|
||||
LISTENING_2_EXERCISE_TYPES = ['multipleChoice', 'writeBlanksQuestions']
|
||||
LISTENING_3_EXERCISE_TYPES = ['multipleChoice3Options', 'writeBlanksQuestions']
|
||||
LISTENING_4_EXERCISE_TYPES = ['multipleChoice', 'writeBlanksQuestions', 'writeBlanksFill', 'writeBlanksForm']
|
||||
|
||||
TOTAL_READING_PASSAGE_1_EXERCISES = 13
|
||||
TOTAL_READING_PASSAGE_2_EXERCISES = 13
|
||||
@@ -218,7 +245,6 @@ class EducationalContent:
|
||||
"Space Exploration",
|
||||
"Artificial Intelligence",
|
||||
"Climate Change",
|
||||
"World Religions",
|
||||
"The Human Brain",
|
||||
"Renewable Energy",
|
||||
"Cultural Diversity",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
from dependency_injector import providers, containers
|
||||
@@ -6,6 +7,7 @@ from openai import AsyncOpenAI
|
||||
from httpx import AsyncClient as HTTPClient
|
||||
from google.cloud.firestore_v1 import AsyncClient as FirestoreClient
|
||||
from dotenv import load_dotenv
|
||||
from sentence_transformers import SentenceTransformer
|
||||
|
||||
from app.repositories.impl import *
|
||||
from app.services.impl import *
|
||||
@@ -60,16 +62,26 @@ def config_di(
|
||||
|
||||
writing_service = providers.Factory(WritingService, llm=llm, ai_detector=ai_detector)
|
||||
|
||||
with open('app/services/impl/level/mc_variants.json', 'r') as file:
|
||||
mc_variants = json.load(file)
|
||||
|
||||
level_service = providers.Factory(
|
||||
LevelService, llm=llm, document_store=firestore, reading_service=reading_service
|
||||
LevelService, llm=llm, document_store=firestore, mc_variants=mc_variants, reading_service=reading_service,
|
||||
writing_service=writing_service, speaking_service=speaking_service, listening_service=listening_service
|
||||
)
|
||||
|
||||
grade_service = providers.Factory(
|
||||
GradeService, llm=llm
|
||||
)
|
||||
|
||||
embeddings = SentenceTransformer('all-MiniLM-L6-v2')
|
||||
|
||||
training_kb = providers.Factory(
|
||||
TrainingContentKnowledgeBase, embeddings=embeddings
|
||||
)
|
||||
|
||||
training_service = providers.Factory(
|
||||
TrainingService, llm=llm
|
||||
TrainingService, llm=llm, firestore=firestore, training_kb=training_kb
|
||||
)
|
||||
|
||||
# Controllers
|
||||
|
||||
Reference in New Issue
Block a user