cat-llm 0.0.23__tar.gz → 0.0.25__tar.gz
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.
- {cat_llm-0.0.23 → cat_llm-0.0.25}/PKG-INFO +1 -1
- {cat_llm-0.0.23 → cat_llm-0.0.25}/src/catllm/CERAD_functions.py +17 -4
- {cat_llm-0.0.23 → cat_llm-0.0.25}/src/catllm/__about__.py +1 -1
- {cat_llm-0.0.23 → cat_llm-0.0.25}/LICENSE +0 -0
- {cat_llm-0.0.23 → cat_llm-0.0.25}/README.md +0 -0
- {cat_llm-0.0.23 → cat_llm-0.0.25}/pyproject.toml +0 -0
- {cat_llm-0.0.23 → cat_llm-0.0.25}/src/catllm/__init__.py +0 -0
- {cat_llm-0.0.23 → cat_llm-0.0.25}/src/catllm/cat_llm.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cat-llm
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.25
|
|
4
4
|
Summary: A tool for categorizing text data and images using LLMs and vision models
|
|
5
5
|
Project-URL: Documentation, https://github.com/chrissoria/cat-llm#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/chrissoria/cat-llm/issues
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# a function specifically for CERAD Constructional Praxis test
|
|
2
2
|
# specifically for pictures of drawings of shapes like circles, diamonds, rectangles, and cubes
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Areas for improvement:
|
|
6
|
+
1. Prompt refinement: adjusting the prompt so that it produces a more accurate score.
|
|
7
|
+
2. Image preprocessing: adjusting the images so that they are easier to be analyzed by the models.
|
|
8
|
+
3. Model selection: using a different model that is better suited for image analysis.
|
|
9
|
+
4. Model Ensembling: using multiple models and combining their scores to produce a more accurate score.
|
|
10
|
+
5. Prompt ensembling: using multiple prompts and combining their scores to produce a more accurate score.
|
|
11
|
+
6. Post-processing: adjusting the way scores are calculated after the model has output its assessment.
|
|
12
|
+
7. Efficiency: optimizing the code to run faster, cheaper, and more efficiently.
|
|
13
|
+
8. Drawn-format versatility: making the function more versatile to handle different scenarios, such as shapes drawn on tablets.
|
|
14
|
+
9. Image input flexibility: allowing the function to accept images in various formats, such as URLs or raw image data.
|
|
15
|
+
10. Test variety: expanding or adding functions to handle score more tests relevant for cogntive assesment, such as the MMSE.
|
|
16
|
+
11. Error handling: improving error handling to better manage unexpected inputs or model failures.
|
|
17
|
+
"""
|
|
4
18
|
def cerad_drawn_score(
|
|
5
19
|
shape,
|
|
6
20
|
image_input,
|
|
@@ -91,7 +105,7 @@ def cerad_drawn_score(
|
|
|
91
105
|
link1 = []
|
|
92
106
|
extracted_jsons = []
|
|
93
107
|
|
|
94
|
-
for i, img_path in enumerate(tqdm(image_files, desc="
|
|
108
|
+
for i, img_path in enumerate(tqdm(image_files, desc="Scoring images"), start=0):
|
|
95
109
|
# Check validity first
|
|
96
110
|
if img_path is None or not os.path.exists(img_path):
|
|
97
111
|
link1.append("Skipped NaN input or invalid path")
|
|
@@ -118,7 +132,7 @@ def cerad_drawn_score(
|
|
|
118
132
|
f"You are an image-tagging assistant trained in the CERAD Constructional Praxis test.\n"
|
|
119
133
|
f"Task ► Examine the attached image and decide, **for each category below**, "
|
|
120
134
|
f"whether it is PRESENT (1) or NOT PRESENT (0).\n\n"
|
|
121
|
-
f"
|
|
135
|
+
f"{reference_text}"
|
|
122
136
|
f"Categories:\n{categories_str}\n\n"
|
|
123
137
|
f"Output format ► Respond with **only** a JSON object whose keys are the "
|
|
124
138
|
f"quoted category numbers ('1', '2', …) and whose values are 1 or 0. "
|
|
@@ -132,7 +146,6 @@ def cerad_drawn_score(
|
|
|
132
146
|
"image_url": {"url": encoded_image, "detail": "high"},
|
|
133
147
|
},
|
|
134
148
|
]
|
|
135
|
-
print(prompt)
|
|
136
149
|
if model_source == "OpenAI":
|
|
137
150
|
from openai import OpenAI
|
|
138
151
|
client = OpenAI(api_key=api_key)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|