tharu22 commited on
Commit
f493bc9
·
1 Parent(s): ec16d89
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 EmbeddingInput(BaseModel):
18
- message: str
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"