Vela commited on
Commit
95076c1
·
1 Parent(s): 07dc157

modified modules

Browse files
__pycache__/tharinee.cpython-312.pyc ADDED
Binary file (2.98 kB). View file
 
src/api/__pycache__/main.cpython-312.pyc CHANGED
Binary files a/src/api/__pycache__/main.cpython-312.pyc and b/src/api/__pycache__/main.cpython-312.pyc differ
 
src/api/main.py CHANGED
@@ -14,7 +14,7 @@ def home():
14
  @app.get("/predict")
15
  def display_prediction(message : str = "Hello World"):
16
  try:
17
- dimention = logistic_regression.get_label(message)
18
- return {"message" : dimention}
19
  except Exception as e:
20
  return f"Unable to fetch the data {e}"
 
14
  @app.get("/predict")
15
  def display_prediction(message : str = "Hello World"):
16
  try:
17
+ dimention = logistic_regression.get_label(message)
18
+ return dimention
19
  except Exception as e:
20
  return f"Unable to fetch the data {e}"
src/data/__pycache__/sample_data.cpython-312.pyc CHANGED
Binary files a/src/data/__pycache__/sample_data.cpython-312.pyc and b/src/data/__pycache__/sample_data.cpython-312.pyc differ
 
src/data/sample_data.py CHANGED
@@ -1,4 +1,5 @@
1
  import pandas as pd
 
2
 
3
  def get_data_frame(file_path):
4
  df = pd.read_excel(file_path)
 
1
  import pandas as pd
2
+ from sentence_transformers import SentenceTransformer
3
 
4
  def get_data_frame(file_path):
5
  df = pd.read_excel(file_path)
src/modules/__pycache__/logistic_regression.cpython-312.pyc CHANGED
Binary files a/src/modules/__pycache__/logistic_regression.cpython-312.pyc and b/src/modules/__pycache__/logistic_regression.cpython-312.pyc differ
 
src/modules/logistic_regression.py CHANGED
@@ -20,7 +20,8 @@ def get_label(message):
20
  models = LogisticRegression(max_iter=100)
21
  models.fit(X_train_embeddings, y_train)
22
  new_embeddings = model.encode(message)
 
23
  array = np.array(new_embeddings).tolist()
24
  # new_predictions = models.predict(new_embeddings)
25
  dimention = pd.DataFrame(array,columns=["Dimention"])
26
- return dimention
 
20
  models = LogisticRegression(max_iter=100)
21
  models.fit(X_train_embeddings, y_train)
22
  new_embeddings = model.encode(message)
23
+ no_of_dimention = len(new_embeddings)
24
  array = np.array(new_embeddings).tolist()
25
  # new_predictions = models.predict(new_embeddings)
26
  dimention = pd.DataFrame(array,columns=["Dimention"])
27
+ return {"Prediction_Dimention":{no_of_dimention: dimention}}