changed
Browse files- schemas/input_schemas.py +9 -6
- services/sms_service.py +1 -0
schemas/input_schemas.py
CHANGED
@@ -1,19 +1,22 @@
|
|
1 |
-
# app/schemas/input_schemas.py
|
2 |
from pydantic import BaseModel
|
3 |
|
|
|
4 |
class CosineSimilarityInput(BaseModel):
|
5 |
text1: str
|
6 |
text2: str
|
7 |
|
|
|
8 |
class MessageInput(BaseModel):
|
9 |
message: str
|
10 |
|
|
|
|
|
|
|
11 |
|
12 |
-
|
13 |
class CosineSimilarityResponse(BaseModel):
|
14 |
cosine_similarity: float
|
15 |
|
16 |
-
|
17 |
-
class
|
18 |
-
|
19 |
-
|
|
|
|
|
1 |
from pydantic import BaseModel
|
2 |
|
3 |
+
# For Cosine Similarity input
|
4 |
class CosineSimilarityInput(BaseModel):
|
5 |
text1: str
|
6 |
text2: str
|
7 |
|
8 |
+
# For SMS classification input
|
9 |
class MessageInput(BaseModel):
|
10 |
message: str
|
11 |
|
12 |
+
# For Embedding computation input
|
13 |
+
class EmbeddingInput(BaseModel):
|
14 |
+
message: str
|
15 |
|
16 |
+
# For Cosine Similarity output response
|
17 |
class CosineSimilarityResponse(BaseModel):
|
18 |
cosine_similarity: float
|
19 |
|
20 |
+
# For Embedding output response
|
21 |
+
class EmbeddingResponse(BaseModel):
|
22 |
+
embeddings: list
|
|
services/sms_service.py
CHANGED
@@ -6,6 +6,7 @@ from fastapi import HTTPException
|
|
6 |
from schemas.input_schemas import CosineSimilarityResponse
|
7 |
from schemas.input_schemas import EmbeddingResponse
|
8 |
|
|
|
9 |
# Load the trained model and vectorizer
|
10 |
def load_model():
|
11 |
model_path = "models/sms_classifier_model.pkl"
|
|
|
6 |
from schemas.input_schemas import CosineSimilarityResponse
|
7 |
from schemas.input_schemas import EmbeddingResponse
|
8 |
|
9 |
+
|
10 |
# Load the trained model and vectorizer
|
11 |
def load_model():
|
12 |
model_path = "models/sms_classifier_model.pkl"
|