tejastake commited on
Commit
e2ea72c
·
verified ·
1 Parent(s): 7f6a24f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -74,17 +74,17 @@ class EmbeddingModels:
74
  df_chunk = self.preprocessing_patent_data(df_chunk)
75
  txt_sp = self.sparse_model.encode_documents(df_chunk)
76
 
77
- tensor = torch.tensor(txt_sp['values'])
78
- normalized_tensor = F.normalize(tensor, p=2.0, dim=0, eps=1e-12)
79
- values = normalized_tensor.tolist()
80
-
81
- # Update the sparse_vector with normalized values
82
- normalized_sparse_vector = {
83
- 'indices': txt_sp['indices'],
84
- 'values': values
85
- }
86
- return normalized_sparse_vector
87
- #return txt_sp
88
 
89
 
90
  model = EmbeddingModels()
 
74
  df_chunk = self.preprocessing_patent_data(df_chunk)
75
  txt_sp = self.sparse_model.encode_documents(df_chunk)
76
 
77
+ # tensor = torch.tensor(txt_sp['values'])
78
+ # normalized_tensor = F.normalize(tensor, p=2.0, dim=0, eps=1e-12)
79
+ # values = normalized_tensor.tolist()
80
+
81
+ # # Update the sparse_vector with normalized values
82
+ # normalized_sparse_vector = {
83
+ # 'indices': txt_sp['indices'],
84
+ # 'values': values
85
+ # }
86
+ # return normalized_sparse_vector
87
+ return txt_sp
88
 
89
 
90
  model = EmbeddingModels()