2024-06-06 22:49:43 +04:00
|
|
|
from fastapi import APIRouter
|
2024-06-02 17:33:50 +04:00
|
|
|
from typing import List
|
|
|
|
|
2024-06-08 01:22:35 +04:00
|
|
|
from repository import QuestionRepository
|
|
|
|
|
2024-06-02 17:33:50 +04:00
|
|
|
router = APIRouter(
|
|
|
|
prefix="/class",
|
|
|
|
tags=["Class"],
|
|
|
|
)
|
|
|
|
|
|
|
|
@router.get("/negative")
|
|
|
|
async def get_class_names() -> List[str]:
|
|
|
|
with open(".//neural_network/classification/class_names_negative.txt", "r", encoding="utf-8") as file:
|
|
|
|
class_names = [line.strip() for line in file.readlines()]
|
|
|
|
return class_names
|
|
|
|
|
2024-06-05 00:38:13 +04:00
|
|
|
|
2024-06-02 17:33:50 +04:00
|
|
|
@router.get("/positive")
|
|
|
|
async def get_class_names() -> List[str]:
|
|
|
|
with open(".//neural_network/classification/class_names_positive.txt", "r", encoding="utf-8") as file:
|
|
|
|
class_names = [line.strip() for line in file.readlines()]
|
|
|
|
return class_names
|
2024-06-06 23:37:38 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-08 01:22:35 +04:00
|
|
|
|