folder-classifier 0.3.7__tar.gz → 0.3.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: folder-classifier
3
- Version: 0.3.7
3
+ Version: 0.3.8
4
4
  Summary: Deploy folder classifier API to a Ray cluster
5
5
  Author: Crispin Almodovar
6
6
  Author-email:
@@ -15,17 +15,17 @@ No markdown (no backticks or code blocks) or any extra text outside the JSON. No
15
15
  """.strip()
16
16
 
17
17
  USER_PROMPT_TEMPLATE = r"""
18
- Task: Classify the folder tree as 'matter' or 'other'.
18
+ Task: Classify the root folder as 'matter' or 'other'.
19
19
 
20
20
  Decision rules (apply in order):
21
21
  1) If there are no files with extension anywhere in the tree , classify as 'other'.
22
22
  2) If the root folder appears to be a container of multiple matters , classify as 'other'.
23
- 3) If the root folder is or ends with a common subfolder name or descriptor found inside legal matters (e.g.,"Email", "Summons" "Emails", "Documents", "Correspondence", "Drafts", "Pleadings", "Court Documents", "Billing", or similar descriptive folder types), classify as 'other' even if it contains legal documents.
24
-
25
- 4) If the root folder name matches any Matter Folder Naming Pattern and there is at least one file with an extension anywhere in the tree (including subfolders), and there is at least one file, subfolder, or filename that directly and unambiguously references a legal, client-matter, or professional context—for example, a legal document type, an initial or core legal document, clear legal terminology, a jurisdiction/court reference, the name of a law firm or legal/financial professional, or an activity specific to legal work—classify as 'matter'.
23
+ 3) If the root folder is or ends with a common subfolder name or descriptor found inside legal matters (e.g.,"Email", "Summons" "Emails", "Documents", "Correspondence", "Drafts", "Pleadings", "Court Documents", "Billing", or similar descriptive folder types), classify as 'other' even if it contains legal documents.
24
+ 4) If the root folder is a subfolder of a matter, classify as other
25
+ 5) If the root folder name matches any Matter Folder Naming Pattern and there is at least one file with an extension anywhere in the tree (including subfolders), and there is at least one file, subfolder, or filename that directly and unambiguously references a legal, client-matter, or professional context—for example, a legal document type, an initial or core legal document, clear legal terminology, a jurisdiction/court reference, the name of a law firm or legal/financial professional, or an activity specific to legal work—classify as 'matter'.
26
26
  Do not classify as 'matter' if the folder only contains general business documents (e.g., invoices, estimates, generic correspondence) and there are no strong indicators of legal, client, or matter-related content as defined above
27
- 5) If the root folder name very compellingly looks like a matter folder e.g (11206 - AcmeX Pty v Acme Corp), classify as 'matter' even if the documents are not initial/core/legal documents.
28
- 6) If none of the above apply, classify as 'other'.
27
+ 6) If the root folder name very compellingly looks like a matter folder e.g (11206 - AcmeX Pty v Acme Corp), classify as 'matter' even if the documents are not initial/core/legal documents.
28
+ 7) If none of the above apply, classify as 'other'.
29
29
 
30
30
  Matter Folder Naming Patterns (case-insensitive; separators like space, hyphen, underscore are fine):
31
31
  • Matter number alone or combined with a client/surname/company (e.g., "12345", "12345 Smith", "Smith - Contract Dispute").
@@ -69,7 +69,8 @@ Definitions/assumptions:
69
69
 
70
70
  Output format (JSON only, no extra text):
71
71
  {"category": "<matter|other>", "reasoning": "<1–2 short explanation referencing the key rule(s) that decided it>"}
72
-
72
+ ROOT FOLDER:
73
+ {root_folder}
73
74
  FOLDER TREE:
74
75
  {folder_tree}
75
76
  """.strip()
@@ -104,12 +105,15 @@ class FolderClassifier:
104
105
  def _to_chat_completion_request(self, request: FolderClassificationRequest) -> Dict[str, Any]:
105
106
  input_paths = request.items
106
107
  folder = build_folder(input_paths)
108
+ root_folder = folder.name
107
109
  folder_tree = render_tree(folder)
108
110
  chat_completion_request = {
109
111
  "model": self.model,
110
112
  "messages": [
111
113
  {"role": "system", "content": SYSTEM_PROMPT},
112
- {"role": "user", "content": USER_PROMPT_TEMPLATE.replace("{folder_tree}", folder_tree)}
114
+ {"role": "user", "content": USER_PROMPT_TEMPLATE.
115
+ replace("{root_folder}", root_folder).
116
+ replace("{folder_tree}", folder_tree)}
113
117
  ],
114
118
  "max_tokens": 1024,
115
119
  "temperature": 0.7,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: folder-classifier
3
- Version: 0.3.7
3
+ Version: 0.3.8
4
4
  Summary: Deploy folder classifier API to a Ray cluster
5
5
  Author: Crispin Almodovar
6
6
  Author-email:
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = folder-classifier
3
- version = 0.3.7
3
+ version = 0.3.8
4
4
  author = Crispin Almodovar
5
5
  author_email =
6
6
  description = Deploy folder classifier API to a Ray cluster