aiagents4pharma 1.35.0__py3-none-any.whl → 1.36.0__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.
- aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +9 -2
- aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ols.py +20 -13
- {aiagents4pharma-1.35.0.dist-info → aiagents4pharma-1.36.0.dist-info}/METADATA +23 -8
- {aiagents4pharma-1.35.0.dist-info → aiagents4pharma-1.36.0.dist-info}/RECORD +7 -7
- {aiagents4pharma-1.35.0.dist-info → aiagents4pharma-1.36.0.dist-info}/WHEEL +0 -0
- {aiagents4pharma-1.35.0.dist-info → aiagents4pharma-1.36.0.dist-info}/licenses/LICENSE +0 -0
- {aiagents4pharma-1.35.0.dist-info → aiagents4pharma-1.36.0.dist-info}/top_level.txt +0 -0
@@ -2,17 +2,23 @@
|
|
2
2
|
Test cases for utils/embeddings/sentence_transformer.py
|
3
3
|
"""
|
4
4
|
|
5
|
-
import pytest
|
6
5
|
import numpy as np
|
6
|
+
import pytest
|
7
|
+
|
7
8
|
from ..utils.embeddings.sentence_transformer import EmbeddingWithSentenceTransformer
|
8
9
|
|
10
|
+
|
9
11
|
@pytest.fixture(name="embedding_model")
|
10
12
|
def embedding_model_fixture():
|
11
13
|
"""
|
12
14
|
Fixture for creating an instance of EmbeddingWithSentenceTransformer.
|
13
15
|
"""
|
14
16
|
model_name = "sentence-transformers/all-MiniLM-L6-v1" # Small model for testing
|
15
|
-
|
17
|
+
embedding_model = EmbeddingWithSentenceTransformer(model_name=model_name)
|
18
|
+
# Move underlying model to CPU for testing
|
19
|
+
embedding_model.model.to("cpu")
|
20
|
+
return embedding_model
|
21
|
+
|
16
22
|
|
17
23
|
def test_embed_documents(embedding_model):
|
18
24
|
"""
|
@@ -27,6 +33,7 @@ def test_embed_documents(embedding_model):
|
|
27
33
|
assert len(embeddings[0]) == 384
|
28
34
|
assert embeddings.dtype == np.float32
|
29
35
|
|
36
|
+
|
30
37
|
def test_embed_query(embedding_model):
|
31
38
|
"""
|
32
39
|
Test the embed_query method of EmbeddingWithSentenceTransformer class.
|
@@ -19,24 +19,28 @@ from ..utils.enrichments.ols_terms import EnrichmentWithOLS
|
|
19
19
|
CL_DESC = "CD4-positive, alpha-beta T cell"
|
20
20
|
GO_DESC = "Any process that activates or increases the frequency, rate or extent"
|
21
21
|
UBERON_DESC = "The olfactory organ of vertebrates, consisting of nares"
|
22
|
-
HP_DESC = "
|
22
|
+
HP_DESC = "Developmental hypoplasia of the antihelix"
|
23
23
|
MONDO_DESC = "A gastrointestinal disorder characterized by chronic inflammation"
|
24
24
|
|
25
25
|
# The expected description for the non-existing term is None
|
26
26
|
|
27
|
+
|
27
28
|
@pytest.fixture(name="enrich_obj")
|
28
29
|
def fixture_uniprot_config():
|
29
30
|
"""Return a dictionary with the configuration for OLS enrichment."""
|
30
31
|
return EnrichmentWithOLS()
|
31
32
|
|
33
|
+
|
32
34
|
def test_enrich_documents(enrich_obj):
|
33
35
|
"""Test the enrich_documents method."""
|
34
|
-
ols_terms = [
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
ols_terms = [
|
37
|
+
"CL_0000899",
|
38
|
+
"GO_0046427",
|
39
|
+
"UBERON_0000004",
|
40
|
+
"HP_0009739",
|
41
|
+
"MONDO_0005011",
|
42
|
+
"XYZ_0000000",
|
43
|
+
]
|
40
44
|
descriptions = enrich_obj.enrich_documents(ols_terms)
|
41
45
|
assert descriptions[0].startswith(CL_DESC)
|
42
46
|
assert descriptions[1].startswith(GO_DESC)
|
@@ -45,14 +49,17 @@ def test_enrich_documents(enrich_obj):
|
|
45
49
|
assert descriptions[4].startswith(MONDO_DESC)
|
46
50
|
assert descriptions[5] is None
|
47
51
|
|
52
|
+
|
48
53
|
def test_enrich_documents_with_rag(enrich_obj):
|
49
54
|
"""Test the enrich_documents_with_rag method."""
|
50
|
-
ols_terms = [
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
55
|
+
ols_terms = [
|
56
|
+
"CL_0000899",
|
57
|
+
"GO_0046427",
|
58
|
+
"UBERON_0000004",
|
59
|
+
"HP_0009739",
|
60
|
+
"MONDO_0005011",
|
61
|
+
"XYZ_0000000",
|
62
|
+
]
|
56
63
|
descriptions = enrich_obj.enrich_documents_with_rag(ols_terms, None)
|
57
64
|
assert descriptions[0].startswith(CL_DESC)
|
58
65
|
assert descriptions[1].startswith(GO_DESC)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.36.0
|
4
4
|
Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D.
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
@@ -90,6 +90,17 @@ Our toolkit currently consists of the following agents:
|
|
90
90
|
|
91
91
|

|
92
92
|
|
93
|
+
## News
|
94
|
+
|
95
|
+
- T2B and T2KG accepted at the MLGenX workshop during ICLR #2025 in Singapore. [Read More](https://openreview.net/forum?id=av4QhBNeZo)
|
96
|
+
|
97
|
+
<div align="center">
|
98
|
+
<strong>Watch the presentation:</strong><br><br>
|
99
|
+
<a href="https://www.youtube.com/watch?v=3cU_OxY4HiE">
|
100
|
+
<img src="https://img.youtube.com/vi/3cU_OxY4HiE/0.jpg" alt="Watch the presentation" width="480">
|
101
|
+
</a>
|
102
|
+
</div>
|
103
|
+
|
93
104
|
## Getting Started
|
94
105
|
|
95
106
|
### Installation
|
@@ -250,15 +261,19 @@ If you are using docker on Windows, please follow these [Windows Setup Notes](#n
|
|
250
261
|

|
251
262
|
|
252
263
|
1. **Clone the repository:**
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
264
|
+
|
265
|
+
```sh
|
266
|
+
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
267
|
+
cd AIAgents4Pharma
|
268
|
+
```
|
269
|
+
|
257
270
|
2. **Install dependencies:**
|
258
271
|
|
259
|
-
|
260
|
-
|
261
|
-
|
272
|
+
We use Conda as our environment manager, Follow the official [Quickstart](https://www.anaconda.com/docs/getting-started/miniconda/install#quickstart-install-instructions) install instructions provided by anaconda/miniconda.
|
273
|
+
|
274
|
+
```python
|
275
|
+
conda create --name AIAgents4Pharma python=3.12 -y && conda activate AIAgents4Pharma && pip install --upgrade pip && pip install -r requirements.txt
|
276
|
+
```
|
262
277
|
|
263
278
|
3. **Initialize API Keys**
|
264
279
|
|
@@ -108,10 +108,10 @@ aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py,s
|
|
108
108
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py,sha256=hzX84pheZdEsTtikF2KtBFiH44_xPjYXxLA6p4Ax1CY,1623
|
109
109
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_nim_molmim.py,sha256=LwtTZ-M7lHGxvRrGBXbyIT8AkA3T2OpeKqtNq3RK7Ik,2164
|
110
110
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_ollama.py,sha256=jn-TrPwF0aR9kVoerwkbMZa3U6Hc6HjV6Zoau4qSH4g,1834
|
111
|
-
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py,sha256=
|
111
|
+
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py,sha256=Xkuf2UFGCXldj1zcsh6kqfQYLDf5i0B6KP3KcmNLSzQ,1452
|
112
112
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_enrichments.py,sha256=N6HRr4lWHXY7bTHe2uXJe4D_EG9WqZPibZne6qLl9_k,1447
|
113
113
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ollama.py,sha256=JhY7axvVULLywDJ2ctA-gob5YPeaJYWsaMNjHT6L9CU,3021
|
114
|
-
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ols.py,sha256=
|
114
|
+
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_ols.py,sha256=5GTSkfKSDS5geR0YfilfnDyUsYli0hv7N8PiDwRvlIE,2370
|
115
115
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_pubchem.py,sha256=0SgYvqdvxseUYTHx2KuSNI2hnmQ3VVVz0F-79_-P41o,1769
|
116
116
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_reactome.py,sha256=r1D74mavsnSCm4xnWl0n0nM9PZqgm3doD2dulNrKNVQ,1754
|
117
117
|
aiagents4pharma/talk2knowledgegraphs/tests/test_utils_enrichments_uniprot.py,sha256=G13Diw7cA5TGINUNO1CDnN4rM6KbepxRXNjuzY578DI,1611
|
@@ -225,8 +225,8 @@ aiagents4pharma/talk2scholars/tools/zotero/utils/read_helper.py,sha256=lyrfpx8NH
|
|
225
225
|
aiagents4pharma/talk2scholars/tools/zotero/utils/review_helper.py,sha256=IPD1V9yrBYaDnRe7sR6PrpwR82OBJbA2P_Tc6RbxAbM,2748
|
226
226
|
aiagents4pharma/talk2scholars/tools/zotero/utils/write_helper.py,sha256=ALwLecy1QVebbsmXJiDj1GhGmyhq2R2tZlAyEl1vfhw,7410
|
227
227
|
aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_path.py,sha256=oIrfbOySgts50ksHKyjcWjRkPRIS88g3Lc0v9mBkU8w,6375
|
228
|
-
aiagents4pharma-1.
|
229
|
-
aiagents4pharma-1.
|
230
|
-
aiagents4pharma-1.
|
231
|
-
aiagents4pharma-1.
|
232
|
-
aiagents4pharma-1.
|
228
|
+
aiagents4pharma-1.36.0.dist-info/licenses/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
|
229
|
+
aiagents4pharma-1.36.0.dist-info/METADATA,sha256=4S4eCTvL7mAxQUmSDp4SIyn2WAYuOivLpcCdL-j5dGQ,16757
|
230
|
+
aiagents4pharma-1.36.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
231
|
+
aiagents4pharma-1.36.0.dist-info/top_level.txt,sha256=-AH8rMmrSnJtq7HaAObS78UU-cTCwvX660dSxeM7a0A,16
|
232
|
+
aiagents4pharma-1.36.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|