Spaces:
Running
Running
Commit
·
c0e3d8f
1
Parent(s):
caa12e0
Add focus and specificity parameters to auto-extract UI
Browse files- Update requirements.txt to use cat-llm>=0.1.7 from PyPI
- Add 'Category Specificity' radio (Broad/Specific)
- Add optional 'Focus' text input for guiding category extraction
- Pass new parameters to catllm.extract()
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- app.py +17 -1
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -860,6 +860,19 @@ with col_input:
|
|
| 860 |
help="How many categories should be identified in your data"
|
| 861 |
)
|
| 862 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
# Model selection for extraction
|
| 864 |
st.markdown("### Model Selection")
|
| 865 |
model_tier = st.radio(
|
|
@@ -923,10 +936,13 @@ with col_input:
|
|
| 923 |
'description': description,
|
| 924 |
'user_model': model,
|
| 925 |
'model_source': model_source,
|
| 926 |
-
'max_categories': int(max_categories)
|
|
|
|
| 927 |
}
|
| 928 |
if mode:
|
| 929 |
extract_kwargs['mode'] = mode
|
|
|
|
|
|
|
| 930 |
|
| 931 |
try:
|
| 932 |
extract_result = catllm.extract(**extract_kwargs)
|
|
|
|
| 860 |
help="How many categories should be identified in your data"
|
| 861 |
)
|
| 862 |
|
| 863 |
+
specificity = st.radio(
|
| 864 |
+
"Category Specificity",
|
| 865 |
+
options=["Broad", "Specific"],
|
| 866 |
+
horizontal=True,
|
| 867 |
+
help="Broad categories are general themes; Specific categories are more detailed"
|
| 868 |
+
)
|
| 869 |
+
|
| 870 |
+
focus = st.text_input(
|
| 871 |
+
"Focus (optional)",
|
| 872 |
+
placeholder="e.g., 'decisions to move', 'emotional responses', 'financial factors'",
|
| 873 |
+
help="Guide the model to prioritize extracting categories related to this focus"
|
| 874 |
+
)
|
| 875 |
+
|
| 876 |
# Model selection for extraction
|
| 877 |
st.markdown("### Model Selection")
|
| 878 |
model_tier = st.radio(
|
|
|
|
| 936 |
'description': description,
|
| 937 |
'user_model': model,
|
| 938 |
'model_source': model_source,
|
| 939 |
+
'max_categories': int(max_categories),
|
| 940 |
+
'specificity': specificity.lower()
|
| 941 |
}
|
| 942 |
if mode:
|
| 943 |
extract_kwargs['mode'] = mode
|
| 944 |
+
if focus and focus.strip():
|
| 945 |
+
extract_kwargs['focus'] = focus.strip()
|
| 946 |
|
| 947 |
try:
|
| 948 |
extract_result = catllm.extract(**extract_kwargs)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
streamlit>=1.32.0
|
| 2 |
-
cat-llm[pdf]
|
| 3 |
mistralai
|
| 4 |
pydantic==2.10.6
|
| 5 |
huggingface_hub<0.27.0
|
|
|
|
| 1 |
streamlit>=1.32.0
|
| 2 |
+
cat-llm[pdf]>=0.1.7
|
| 3 |
mistralai
|
| 4 |
pydantic==2.10.6
|
| 5 |
huggingface_hub<0.27.0
|