ddi-fw 0.0.251__py3-none-any.whl → 0.0.252__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,16 +56,20 @@ class FaissVectorStoreManager(BaseVectorStoreManager):
56
56
 
57
57
  # uuids = [str(uuid4()) for _ in range(len(docs))]
58
58
  # self.vector_store.add_documents(documents=docs, ids=uuids)
59
-
59
+
60
60
  def initialize_embedding_dict(self, **kwargs):
61
- # vector_db_persist_directory = kwargs.get("vector_db_persist_directory")
61
+ """
62
+ Initializes a dictionary where keys are types (e.g., 'description', 'indication'),
63
+ and values are dictionaries mapping drugbank_ids to a list of their embeddings.
64
+
65
+ Returns:
66
+ dict: A dictionary with the structure {type: {drugbank_id: [embedding]}}.
67
+ """
62
68
  self.load(self.persist_directory)
63
69
  df = self.as_dataframe(formatter_fn=custom_formatter)
64
- type_dict = (
65
- df.groupby('type')
66
- .apply(lambda group: dict(zip(group['id'], group['embedding'])))
67
- .to_dict()
68
- )
70
+ type_dict = {}
71
+ for drug_type, group in df.groupby('type'):
72
+ type_dict[drug_type] = dict(zip(group['id'], group['embedding'].apply(lambda x: [x])))
69
73
  return type_dict
70
74
 
71
75
  def generate_vector_store(self, docs, handle_empty='zero'):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ddi_fw
3
- Version: 0.0.251
3
+ Version: 0.0.252
4
4
  Summary: Do not use :)
5
5
  Author-email: Kıvanç Bayraktar <bayraktarkivanc@gmail.com>
6
6
  Maintainer-email: Kıvanç Bayraktar <bayraktarkivanc@gmail.com>
@@ -6,7 +6,7 @@ ddi_fw/datasets/setup_._py,sha256=khYVJuW5PlOY_i_A16F3UbSZ6s6o_ljw33Byw3C-A8E,10
6
6
  ddi_fw/langchain/__init__.py,sha256=xGNaTEZCUxyc_aT1zvzVWGRfsj-9VXqMvPKtV_G7ChA,399
7
7
  ddi_fw/langchain/chroma_storage.py,sha256=7LSUhdiPdQHZvKC_NapOeVbHtS71iE5ABZVTrI0YQ-A,15520
8
8
  ddi_fw/langchain/embeddings.py,sha256=eEWy4okcjdhUJHi4N48Wd8XauPXyeaQVLUdNWEvtEcY,6754
9
- ddi_fw/langchain/faiss_storage.py,sha256=os7OuUwB1WbeX5Ptw6kxES6MntKXjTTcpPtkJMBgi14,13608
9
+ ddi_fw/langchain/faiss_storage.py,sha256=CiN3f5FvDlmGAcxmoQOQSmfkz7QolcnKBlnrJIzxp8k,13840
10
10
  ddi_fw/langchain/sentence_splitter.py,sha256=h_bYElx4Ud1mwDNJfL7mUwvgadwKX3GKlSzu5L2PXzg,280
11
11
  ddi_fw/langchain/storage.py,sha256=OizKyWm74Js7T6Q9kez-ulUoBGzIMFo4R46h4kjUyIM,11200
12
12
  ddi_fw/ml/__init__.py,sha256=FteYEawCkVQOaK-cTv2VrHZ2ZnfeFr31BD6VucO7_DQ,268
@@ -38,7 +38,7 @@ ddi_fw/utils/zip_helper.py,sha256=YRZA4tKZVBJwGQM0_WK6L-y5MoqkKoC-nXuuHK6CU9I,55
38
38
  ddi_fw/vectorization/__init__.py,sha256=LcJOpLVoLvHPDw9phGFlUQGeNcST_zKV-Oi1Pm5h_nE,110
39
39
  ddi_fw/vectorization/feature_vector_generation.py,sha256=QQQGhCti653BdU343Ag1bH_g1fzi2hlic7dgNy7otjE,7694
40
40
  ddi_fw/vectorization/idf_helper.py,sha256=_Gd1dtDSLaw8o-o0JugzSKMt9FpeXewTh4wGEaUd4VQ,2571
41
- ddi_fw-0.0.251.dist-info/METADATA,sha256=GxHCFYuKnptAcelnZaLCOziDuHD798ptjslXgW6xXHk,2623
42
- ddi_fw-0.0.251.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- ddi_fw-0.0.251.dist-info/top_level.txt,sha256=PMwHICFZTZtcpzQNPV4UQnfNXYIeLR_Ste-Wfc1h810,7
44
- ddi_fw-0.0.251.dist-info/RECORD,,
41
+ ddi_fw-0.0.252.dist-info/METADATA,sha256=biw1UajkdiADjgL7qB2zAAJTM0Ts4WUAeL5AqTiYiNw,2623
42
+ ddi_fw-0.0.252.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ ddi_fw-0.0.252.dist-info/top_level.txt,sha256=PMwHICFZTZtcpzQNPV4UQnfNXYIeLR_Ste-Wfc1h810,7
44
+ ddi_fw-0.0.252.dist-info/RECORD,,