cat-llm 0.0.24__py3-none-any.whl → 0.0.26__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.
- {cat_llm-0.0.24.dist-info → cat_llm-0.0.26.dist-info}/METADATA +1 -1
- cat_llm-0.0.26.dist-info/RECORD +9 -0
- catllm/CERAD_functions.py +30 -9
- catllm/__about__.py +1 -1
- catllm/__init__.py +2 -1
- catllm/cat_llm.py +0 -1008
- catllm/image_functions.py +689 -0
- cat_llm-0.0.24.dist-info/RECORD +0 -8
- {cat_llm-0.0.24.dist-info → cat_llm-0.0.26.dist-info}/WHEEL +0 -0
- {cat_llm-0.0.24.dist-info → cat_llm-0.0.26.dist-info}/licenses/LICENSE +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.26
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
catllm/CERAD_functions.py,sha256=mtHxshRWmWXMH9kkkCfbMHXgDe00EVabjFiN8s73LPI,16935
|
|
2
|
+
catllm/__about__.py,sha256=4jqHFlCUy8Xa_lkK5V6tmc1z_Goja59oOIaD7pFXnRs,404
|
|
3
|
+
catllm/__init__.py,sha256=kLk180aJna1s-wU6CLr4_hKkbjoeET-11jGmC1pdhQw,330
|
|
4
|
+
catllm/cat_llm.py,sha256=Rwyz93caNf0h9tfurObY6qDjtG6EKaYXR0GrVW7h2kU,16920
|
|
5
|
+
catllm/image_functions.py,sha256=nTppbeeuYrlDmZtUkEwNwRJQ6YbBxBCYoPRU1X4GZOY,27100
|
|
6
|
+
cat_llm-0.0.26.dist-info/METADATA,sha256=uXjULRmbv-RQu9Q1aU3rXuYo1d4qK-163M2i-j5Sb1o,1679
|
|
7
|
+
cat_llm-0.0.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
cat_llm-0.0.26.dist-info/licenses/LICENSE,sha256=wJLsvOr6lrFUDcoPXExa01HOKFWrS3JC9f0RudRw8uw,1075
|
|
9
|
+
cat_llm-0.0.26.dist-info/RECORD,,
|
catllm/CERAD_functions.py
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
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
|
+
|
|
4
|
+
"""
|
|
5
|
+
Ket features:
|
|
6
|
+
1. Shape-specific scoring: The function can handle different shapes (circle, diamond, rectangles, cube) and provides tailored categories for each shape.
|
|
7
|
+
2. Image input handling: It accepts image inputs either as file paths or a list of images.
|
|
8
|
+
3. Model flexibility: The function allows users to specify different models (OpenAI, Anthropic, Perplexity, Mistral) for image analysis.
|
|
9
|
+
4. Safety and progress saving: It can save progress to a CSV file, which is useful for long-running tasks or when processing many images.
|
|
10
|
+
|
|
11
|
+
Areas for improvement:
|
|
12
|
+
1. Prompt refinement: adjusting the prompt so that it produces a more accurate score.
|
|
13
|
+
2. Image preprocessing: adjusting the images so that they are easier to be analyzed by the models.
|
|
14
|
+
3. Model selection: using a different model that is better suited for image analysis.
|
|
15
|
+
4. Model Ensembling: using multiple models and combining their scores to produce a more accurate score.
|
|
16
|
+
5. Prompt ensembling: using multiple prompts and combining their scores to produce a more accurate score.
|
|
17
|
+
6. Post-processing: adjusting the way scores are calculated after the model has output its assessment.
|
|
18
|
+
7. Efficiency: optimizing the code to run faster, cheaper, and more efficiently.
|
|
19
|
+
8. Drawn-format versatility: making the function more versatile to handle different scenarios, such as shapes drawn on tablets.
|
|
20
|
+
9. Image input flexibility: allowing the function to accept images in various formats, such as URLs or raw image data.
|
|
21
|
+
10. Test variety: expanding or adding functions to handle score more tests relevant for cogntive assesment, such as the MMSE.
|
|
22
|
+
11. Error handling: improving error handling to better manage unexpected inputs or model failures.
|
|
23
|
+
"""
|
|
3
24
|
def cerad_drawn_score(
|
|
4
25
|
shape,
|
|
5
26
|
image_input,
|
|
6
27
|
api_key,
|
|
7
|
-
user_model="gpt-4o
|
|
28
|
+
user_model="gpt-4o",
|
|
8
29
|
creativity=0,
|
|
9
30
|
reference_in_image=False,
|
|
10
31
|
provide_reference=False,
|
|
@@ -25,8 +46,8 @@ def cerad_drawn_score(
|
|
|
25
46
|
|
|
26
47
|
if shape == "circle":
|
|
27
48
|
categories = ["The image contains a drawing that clearly represents a circle",
|
|
28
|
-
"The
|
|
29
|
-
"The drawing resembles a circle",
|
|
49
|
+
"The image does NOT contain any drawing that resembles a circle",
|
|
50
|
+
"The image contains a drawing that resembles a circle",
|
|
30
51
|
"The circle is closed",
|
|
31
52
|
"The circle is almost closed",
|
|
32
53
|
"The circle is circular",
|
|
@@ -43,12 +64,12 @@ def cerad_drawn_score(
|
|
|
43
64
|
"None of the above descriptions apply"]
|
|
44
65
|
elif shape == "rectangles" or shape == "overlapping rectangles":
|
|
45
66
|
categories = ["The image contains a drawing that clearly represents overlapping rectangles",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"The rectangles are overlapping",
|
|
51
|
-
"The rectangles overlap
|
|
67
|
+
"The image does NOT contain any drawing that resembles overlapping rectangles",
|
|
68
|
+
"The image contains a drawing that resembles overlapping rectangles",
|
|
69
|
+
"If rectangle 1 is present it has 4 sides",
|
|
70
|
+
"If rectablge 2 is present it has 4 sides",
|
|
71
|
+
"The drawn rectangles are overlapping",
|
|
72
|
+
"The drawn rectangles overlap to form a longer vertical rectangle with top and bottom sticking out",
|
|
52
73
|
"None of the above descriptions apply"]
|
|
53
74
|
elif shape == "cube":
|
|
54
75
|
categories = ["The image contains a drawing that clearly represents a cube (3D box shape)",
|
catllm/__about__.py
CHANGED
catllm/__init__.py
CHANGED