cat-llm 0.0.23__py3-none-any.whl → 0.0.25__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cat-llm
3
- Version: 0.0.23
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
@@ -0,0 +1,8 @@
1
+ catllm/CERAD_functions.py,sha256=0tuFryVZ2CDVsq3FBhdx0KI23avELxHiDrg7-i5sXPU,16281
2
+ catllm/__about__.py,sha256=W-f0L_ZEOs0IGlGa-98dY1aw1uqUgr-qkJ-M9qKND0U,404
3
+ catllm/__init__.py,sha256=mNp5MQx2aNTtpNBHJ-U9INd1hX3u6jRkOoAewEI25MI,298
4
+ catllm/cat_llm.py,sha256=TJmdM_O9oL7wvTuwohQLY5vgaAttIElCcfXEJHzdhfM,58311
5
+ cat_llm-0.0.25.dist-info/METADATA,sha256=y3Sy6PnVane93b64UENte7uULeAGitvwjPjMaxZGOqg,1679
6
+ cat_llm-0.0.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ cat_llm-0.0.25.dist-info/licenses/LICENSE,sha256=wJLsvOr6lrFUDcoPXExa01HOKFWrS3JC9f0RudRw8uw,1075
8
+ cat_llm-0.0.25.dist-info/RECORD,,
catllm/CERAD_functions.py CHANGED
@@ -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
- # SPDX-FileCopyrightText: 2025-present Christopher Soria <
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="Categorising images"), start=0):
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"Image is expected to show within it a drawing of a {shape}.\n\n"
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)
catllm/__about__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Christopher Soria <chrissoria@berkeley.edu>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.23"
4
+ __version__ = "0.0.25"
5
5
  __author__ = "Chris Soria"
6
6
  __email__ = "chrissoria@berkeley.edu"
7
7
  __title__ = "cat-llm"
@@ -1,8 +0,0 @@
1
- catllm/CERAD_functions.py,sha256=Pxk8EE6fYDXQds_X_rpOkSYdC3qL1uk1J22dNqlIGsU,15245
2
- catllm/__about__.py,sha256=zwS1-qZYSyAy-RZXHHvm1VlcPU3oJNBheC_aGVi7IN0,404
3
- catllm/__init__.py,sha256=mNp5MQx2aNTtpNBHJ-U9INd1hX3u6jRkOoAewEI25MI,298
4
- catllm/cat_llm.py,sha256=TJmdM_O9oL7wvTuwohQLY5vgaAttIElCcfXEJHzdhfM,58311
5
- cat_llm-0.0.23.dist-info/METADATA,sha256=ULEDGfqEUjLUK8g89BAuaIIkmVnsenVM8jvEPpMKErg,1679
6
- cat_llm-0.0.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- cat_llm-0.0.23.dist-info/licenses/LICENSE,sha256=wJLsvOr6lrFUDcoPXExa01HOKFWrS3JC9f0RudRw8uw,1075
8
- cat_llm-0.0.23.dist-info/RECORD,,