Spaces:
Runtime error
Runtime error
changed date regex
Browse files
app.py
CHANGED
|
@@ -30,9 +30,11 @@ def extract_features(tokens, labels):
|
|
| 30 |
#date_pattern = r"\d{1,2}/\d{1,2}/\d{2,4}" # Matches full date formats like MM/DD/YYYY or DD/MM/YYYY
|
| 31 |
#partial_date_pattern = r"\d{1,2}$|[/-]$" # Matches partial date components like "12" or "/" at the end
|
| 32 |
|
| 33 |
-
date_pattern = r"\d{1,2}/\d{1,2}/\d{2,4}" # Matches full date formats like MM/DD/YYYY or DD/MM/YYYY
|
| 34 |
-
partial_date_pattern = r"^\d{1,2}/?$|^[/-]$" # Matches partial date components like "12", "/", "02/", etc.
|
| 35 |
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# This is a label AGNOSTIC approach
|
| 38 |
for token, label in zip(tokens, labels):
|
|
|
|
| 30 |
#date_pattern = r"\d{1,2}/\d{1,2}/\d{2,4}" # Matches full date formats like MM/DD/YYYY or DD/MM/YYYY
|
| 31 |
#partial_date_pattern = r"\d{1,2}$|[/-]$" # Matches partial date components like "12" or "/" at the end
|
| 32 |
|
| 33 |
+
#date_pattern = r"\d{1,2}/\d{1,2}/\d{2,4}" # Matches full date formats like MM/DD/YYYY or DD/MM/YYYY
|
| 34 |
+
#partial_date_pattern = r"^\d{1,2}/?$|^[/-]$" # Matches partial date components like "12", "/", "02/", etc.
|
| 35 |
|
| 36 |
+
date_pattern = r"^\d{2}/\d{2}/\d{2}(\d{2})?$"
|
| 37 |
+
partial_date_pattern = r"\d+/|\d+|/"
|
| 38 |
|
| 39 |
# This is a label AGNOSTIC approach
|
| 40 |
for token, label in zip(tokens, labels):
|