Upload JengaAI model: Police_Case_Multi-Task_v2 — Mar 09 00:25
Browse files- README.md +41 -3
- checkpoints/best/checkpoint_meta.json +32 -0
- checkpoints/best/model.pt +3 -0
- checkpoints/epoch_2/checkpoint_meta.json +32 -0
- checkpoints/epoch_2/model.pt +3 -0
- checkpoints/epoch_3/checkpoint_meta.json +32 -0
- checkpoints/epoch_3/model.pt +3 -0
- config.yaml +112 -0
- encoder_config/config.json +25 -0
- experiment_config.yaml +196 -0
- label_maps.json +91 -0
- metadata.json +22 -0
- model.pt +3 -0
README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- jenga-ai
|
| 4 |
+
- nlp
|
| 5 |
+
pipeline_tag: text-classification
|
| 6 |
+
metrics:
|
| 7 |
+
- accuracy
|
| 8 |
+
- f1
|
| 9 |
+
---
|
| 10 |
+
# Police_Case_Multi-Task_v2 — Mar 09 00:25
|
| 11 |
+
|
| 12 |
+
Fine-tuned with [JengaAI](https://github.com/TujengeAI/JengaAI) — a multi-task NLP training framework.
|
| 13 |
+
|
| 14 |
+
| Metric | Value |
|
| 15 |
+
|--------|-------|
|
| 16 |
+
| Accuracy | N/A |
|
| 17 |
+
| F1 Score | N/A |
|
| 18 |
+
| Modality | NLP |
|
| 19 |
+
|
| 20 |
+
## Loading with JengaAI SDK
|
| 21 |
+
|
| 22 |
+
This model uses a custom `MultiTaskModel` architecture and **requires the JengaAI SDK** to run inference.
|
| 23 |
+
|
| 24 |
+
```python
|
| 25 |
+
from jenga_ai.inference.predictor import MultiTaskPredictor
|
| 26 |
+
|
| 27 |
+
predictor = MultiTaskPredictor.from_checkpoint(
|
| 28 |
+
model_dir="Rogendo/police_case_reporting_multitask_distilbert", # HuggingFace repo ID
|
| 29 |
+
)
|
| 30 |
+
result = predictor.predict("Your text here")
|
| 31 |
+
print(result)
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
## Artifacts
|
| 35 |
+
|
| 36 |
+
| File | Description |
|
| 37 |
+
|------|-------------|
|
| 38 |
+
| `model.pt` | Trained model weights (PyTorch) |
|
| 39 |
+
| `experiment_config.yaml` | Full training config with label maps |
|
| 40 |
+
| `label_maps.json` | Class label mappings per task |
|
| 41 |
+
| `encoder_config/` | Base encoder tokenizer & config |
|
checkpoints/best/checkpoint_meta.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 0,
|
| 3 |
+
"metrics": {
|
| 4 |
+
"sentiment_sentiment_accuracy": 0.5,
|
| 5 |
+
"sentiment_sentiment_precision": 0.5,
|
| 6 |
+
"sentiment_sentiment_recall": 0.5,
|
| 7 |
+
"sentiment_sentiment_f1": 0.5,
|
| 8 |
+
"main_category_main_category_accuracy": 0.0,
|
| 9 |
+
"main_category_main_category_precision": 0.0,
|
| 10 |
+
"main_category_main_category_recall": 0.0,
|
| 11 |
+
"main_category_main_category_f1": 0.0,
|
| 12 |
+
"subcategory_subcategory_accuracy": 0.0,
|
| 13 |
+
"subcategory_subcategory_precision": 0.0,
|
| 14 |
+
"subcategory_subcategory_recall": 0.0,
|
| 15 |
+
"subcategory_subcategory_f1": 0.0,
|
| 16 |
+
"priority_priority_accuracy": 0.0,
|
| 17 |
+
"priority_priority_precision": 0.0,
|
| 18 |
+
"priority_priority_recall": 0.0,
|
| 19 |
+
"priority_priority_f1": 0.0,
|
| 20 |
+
"intervention_intervention_accuracy": 0.0,
|
| 21 |
+
"intervention_intervention_precision": 0.0,
|
| 22 |
+
"intervention_intervention_recall": 0.0,
|
| 23 |
+
"intervention_intervention_f1": 0.0,
|
| 24 |
+
"entity_extraction_entity_extraction_accuracy": 0.7372881355932204,
|
| 25 |
+
"entity_extraction_entity_extraction_precision": 0.7372881355932204,
|
| 26 |
+
"entity_extraction_entity_extraction_recall": 0.7372881355932204,
|
| 27 |
+
"entity_extraction_entity_extraction_f1": 0.7372881355932204,
|
| 28 |
+
"eval_loss": 2.293487270673116,
|
| 29 |
+
"train_loss_avg": 2.2960834205150604
|
| 30 |
+
},
|
| 31 |
+
"is_best": true
|
| 32 |
+
}
|
checkpoints/best/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef8b20ff817c8f14541763fd58b45d1cc75b90f658a0c8dcf8640e4e7e7c6dff
|
| 3 |
+
size 270439507
|
checkpoints/epoch_2/checkpoint_meta.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 2,
|
| 3 |
+
"metrics": {
|
| 4 |
+
"sentiment_sentiment_accuracy": 0.5,
|
| 5 |
+
"sentiment_sentiment_precision": 0.5,
|
| 6 |
+
"sentiment_sentiment_recall": 0.5,
|
| 7 |
+
"sentiment_sentiment_f1": 0.5,
|
| 8 |
+
"main_category_main_category_accuracy": 0.0,
|
| 9 |
+
"main_category_main_category_precision": 0.0,
|
| 10 |
+
"main_category_main_category_recall": 0.0,
|
| 11 |
+
"main_category_main_category_f1": 0.0,
|
| 12 |
+
"subcategory_subcategory_accuracy": 0.0,
|
| 13 |
+
"subcategory_subcategory_precision": 0.0,
|
| 14 |
+
"subcategory_subcategory_recall": 0.0,
|
| 15 |
+
"subcategory_subcategory_f1": 0.0,
|
| 16 |
+
"priority_priority_accuracy": 0.0,
|
| 17 |
+
"priority_priority_precision": 0.0,
|
| 18 |
+
"priority_priority_recall": 0.0,
|
| 19 |
+
"priority_priority_f1": 0.0,
|
| 20 |
+
"intervention_intervention_accuracy": 0.0,
|
| 21 |
+
"intervention_intervention_precision": 0.0,
|
| 22 |
+
"intervention_intervention_recall": 0.0,
|
| 23 |
+
"intervention_intervention_f1": 0.0,
|
| 24 |
+
"entity_extraction_entity_extraction_accuracy": 0.847457627118644,
|
| 25 |
+
"entity_extraction_entity_extraction_precision": 0.7181844297615627,
|
| 26 |
+
"entity_extraction_entity_extraction_recall": 0.847457627118644,
|
| 27 |
+
"entity_extraction_entity_extraction_f1": 0.7774840615767377,
|
| 28 |
+
"eval_loss": 2.5300551454226174,
|
| 29 |
+
"train_loss_avg": 1.4021934138403997
|
| 30 |
+
},
|
| 31 |
+
"is_best": false
|
| 32 |
+
}
|
checkpoints/epoch_2/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6fa46fc88dee4fdefa84f807dd62c8e458004e2c041f5616f271f9750a761a74
|
| 3 |
+
size 270439507
|
checkpoints/epoch_3/checkpoint_meta.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"epoch": 3,
|
| 3 |
+
"metrics": {
|
| 4 |
+
"sentiment_sentiment_accuracy": 0.5,
|
| 5 |
+
"sentiment_sentiment_precision": 0.5,
|
| 6 |
+
"sentiment_sentiment_recall": 0.5,
|
| 7 |
+
"sentiment_sentiment_f1": 0.5,
|
| 8 |
+
"main_category_main_category_accuracy": 0.0,
|
| 9 |
+
"main_category_main_category_precision": 0.0,
|
| 10 |
+
"main_category_main_category_recall": 0.0,
|
| 11 |
+
"main_category_main_category_f1": 0.0,
|
| 12 |
+
"subcategory_subcategory_accuracy": 0.0,
|
| 13 |
+
"subcategory_subcategory_precision": 0.0,
|
| 14 |
+
"subcategory_subcategory_recall": 0.0,
|
| 15 |
+
"subcategory_subcategory_f1": 0.0,
|
| 16 |
+
"priority_priority_accuracy": 0.0,
|
| 17 |
+
"priority_priority_precision": 0.0,
|
| 18 |
+
"priority_priority_recall": 0.0,
|
| 19 |
+
"priority_priority_f1": 0.0,
|
| 20 |
+
"intervention_intervention_accuracy": 0.0,
|
| 21 |
+
"intervention_intervention_precision": 0.0,
|
| 22 |
+
"intervention_intervention_recall": 0.0,
|
| 23 |
+
"intervention_intervention_f1": 0.0,
|
| 24 |
+
"entity_extraction_entity_extraction_accuracy": 0.847457627118644,
|
| 25 |
+
"entity_extraction_entity_extraction_precision": 0.7181844297615627,
|
| 26 |
+
"entity_extraction_entity_extraction_recall": 0.847457627118644,
|
| 27 |
+
"entity_extraction_entity_extraction_f1": 0.7774840615767377,
|
| 28 |
+
"eval_loss": 2.5224763651688895,
|
| 29 |
+
"train_loss_avg": 1.2216199677851465
|
| 30 |
+
},
|
| 31 |
+
"is_best": false
|
| 32 |
+
}
|
checkpoints/epoch_3/model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a29701fc9e837a557fd5b08f640ce9bff8876f6e34a933e4614346dfd4b38d4d
|
| 3 |
+
size 270439507
|
config.yaml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
project_name: police_case_multitask
|
| 2 |
+
|
| 3 |
+
model:
|
| 4 |
+
base_model: distilbert-base-uncased
|
| 5 |
+
dropout: 0.1
|
| 6 |
+
freeze_encoder_layers: 0
|
| 7 |
+
gradient_checkpointing: false
|
| 8 |
+
fusion:
|
| 9 |
+
type: attention
|
| 10 |
+
dropout: 0.1
|
| 11 |
+
use_residual: true
|
| 12 |
+
num_attention_heads: 1
|
| 13 |
+
|
| 14 |
+
tokenizer:
|
| 15 |
+
max_length: 512
|
| 16 |
+
padding: max_length
|
| 17 |
+
truncation: true
|
| 18 |
+
|
| 19 |
+
training:
|
| 20 |
+
output_dir: ./results/police_case_multitask
|
| 21 |
+
learning_rate: 0.00002
|
| 22 |
+
batch_size: 4
|
| 23 |
+
num_epochs: 3
|
| 24 |
+
weight_decay: 0.01
|
| 25 |
+
warmup_steps: 50
|
| 26 |
+
max_grad_norm: 1.0
|
| 27 |
+
gradient_accumulation_steps: 1
|
| 28 |
+
use_amp: false
|
| 29 |
+
device: auto
|
| 30 |
+
early_stopping_patience: 3
|
| 31 |
+
metric_for_best_model: eval_loss
|
| 32 |
+
greater_is_better: false
|
| 33 |
+
logging:
|
| 34 |
+
service: mlflow
|
| 35 |
+
experiment_name: police_case_multitask
|
| 36 |
+
tracking_uri: http://localhost:5000
|
| 37 |
+
log_every_n_steps: 10
|
| 38 |
+
checkpoint:
|
| 39 |
+
save_every_n_epochs: 1
|
| 40 |
+
save_best: true
|
| 41 |
+
max_checkpoints: 2
|
| 42 |
+
data:
|
| 43 |
+
test_size: 0.15
|
| 44 |
+
seed: 42
|
| 45 |
+
num_workers: 0
|
| 46 |
+
|
| 47 |
+
tasks:
|
| 48 |
+
- name: sentiment
|
| 49 |
+
type: sentiment
|
| 50 |
+
data_path: test_data/police_cases/police_case_reports.json
|
| 51 |
+
text_column: report_text
|
| 52 |
+
label_column: sentiment
|
| 53 |
+
heads:
|
| 54 |
+
- name: sentiment
|
| 55 |
+
num_labels: 4
|
| 56 |
+
weight: 1.0
|
| 57 |
+
dropout: 0.1
|
| 58 |
+
|
| 59 |
+
- name: main_category
|
| 60 |
+
type: single_label_classification
|
| 61 |
+
data_path: test_data/police_cases/police_case_reports.json
|
| 62 |
+
text_column: report_text
|
| 63 |
+
label_column: main_category
|
| 64 |
+
heads:
|
| 65 |
+
- name: main_category
|
| 66 |
+
num_labels: 10
|
| 67 |
+
weight: 1.0
|
| 68 |
+
dropout: 0.1
|
| 69 |
+
|
| 70 |
+
- name: subcategory
|
| 71 |
+
type: single_label_classification
|
| 72 |
+
data_path: test_data/police_cases/police_case_reports.json
|
| 73 |
+
text_column: report_text
|
| 74 |
+
label_column: subcategory
|
| 75 |
+
heads:
|
| 76 |
+
- name: subcategory
|
| 77 |
+
num_labels: 12
|
| 78 |
+
weight: 1.0
|
| 79 |
+
dropout: 0.1
|
| 80 |
+
|
| 81 |
+
- name: priority
|
| 82 |
+
type: single_label_classification
|
| 83 |
+
data_path: test_data/police_cases/police_case_reports.json
|
| 84 |
+
text_column: report_text
|
| 85 |
+
label_column: priority
|
| 86 |
+
heads:
|
| 87 |
+
- name: priority
|
| 88 |
+
num_labels: 4
|
| 89 |
+
weight: 1.0
|
| 90 |
+
dropout: 0.1
|
| 91 |
+
|
| 92 |
+
- name: intervention
|
| 93 |
+
type: single_label_classification
|
| 94 |
+
data_path: test_data/police_cases/police_case_reports.json
|
| 95 |
+
text_column: report_text
|
| 96 |
+
label_column: intervention
|
| 97 |
+
heads:
|
| 98 |
+
- name: intervention
|
| 99 |
+
num_labels: 7
|
| 100 |
+
weight: 1.0
|
| 101 |
+
dropout: 0.1
|
| 102 |
+
|
| 103 |
+
- name: entity_extraction
|
| 104 |
+
type: ner
|
| 105 |
+
data_path: test_data/police_cases/police_case_reports.json
|
| 106 |
+
text_column: report_text
|
| 107 |
+
label_column: entities
|
| 108 |
+
heads:
|
| 109 |
+
- name: entity_extraction
|
| 110 |
+
num_labels: 15
|
| 111 |
+
weight: 1.0
|
| 112 |
+
dropout: 0.1
|
encoder_config/config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation": "gelu",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"DistilBertForMaskedLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.1,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"dim": 768,
|
| 9 |
+
"dropout": 0.1,
|
| 10 |
+
"eos_token_id": null,
|
| 11 |
+
"hidden_dim": 3072,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"max_position_embeddings": 512,
|
| 14 |
+
"model_type": "distilbert",
|
| 15 |
+
"n_heads": 12,
|
| 16 |
+
"n_layers": 6,
|
| 17 |
+
"pad_token_id": 0,
|
| 18 |
+
"qa_dropout": 0.1,
|
| 19 |
+
"seq_classif_dropout": 0.2,
|
| 20 |
+
"sinusoidal_pos_embds": false,
|
| 21 |
+
"tie_weights_": true,
|
| 22 |
+
"tie_word_embeddings": true,
|
| 23 |
+
"transformers_version": "5.1.0",
|
| 24 |
+
"vocab_size": 30522
|
| 25 |
+
}
|
experiment_config.yaml
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
project_name: police_case_reports_json
|
| 2 |
+
tasks:
|
| 3 |
+
- name: sentiment
|
| 4 |
+
type: sentiment
|
| 5 |
+
data_path: /home/naynek/Desktop/TujengeAI/Update/JengaAI/backend/uploads/datasets/16ced0930e7e_police_case_reports.json
|
| 6 |
+
heads:
|
| 7 |
+
- name: sentiment
|
| 8 |
+
num_labels: 4
|
| 9 |
+
weight: 1.0
|
| 10 |
+
dropout: 0.1
|
| 11 |
+
text_column: report_text
|
| 12 |
+
label_column: sentiment
|
| 13 |
+
label_maps:
|
| 14 |
+
sentiment:
|
| 15 |
+
0: negative
|
| 16 |
+
1: neutral
|
| 17 |
+
2: positive
|
| 18 |
+
3: urgent
|
| 19 |
+
- name: main_category
|
| 20 |
+
type: single_label_classification
|
| 21 |
+
data_path: /home/naynek/Desktop/TujengeAI/Update/JengaAI/backend/uploads/datasets/16ced0930e7e_police_case_reports.json
|
| 22 |
+
heads:
|
| 23 |
+
- name: main_category
|
| 24 |
+
num_labels: 10
|
| 25 |
+
weight: 1.0
|
| 26 |
+
dropout: 0.1
|
| 27 |
+
text_column: report_text
|
| 28 |
+
label_column: main_category
|
| 29 |
+
label_maps:
|
| 30 |
+
main_category:
|
| 31 |
+
0: Child Abuse
|
| 32 |
+
1: Commendation
|
| 33 |
+
2: Drug Abuse
|
| 34 |
+
3: Fraud
|
| 35 |
+
4: Human Trafficking
|
| 36 |
+
5: Missing Person
|
| 37 |
+
6: Theft
|
| 38 |
+
7: Traffic
|
| 39 |
+
8: Vandalism
|
| 40 |
+
9: Violence
|
| 41 |
+
- name: subcategory
|
| 42 |
+
type: single_label_classification
|
| 43 |
+
data_path: /home/naynek/Desktop/TujengeAI/Update/JengaAI/backend/uploads/datasets/16ced0930e7e_police_case_reports.json
|
| 44 |
+
heads:
|
| 45 |
+
- name: subcategory
|
| 46 |
+
num_labels: 24
|
| 47 |
+
weight: 1.0
|
| 48 |
+
dropout: 0.1
|
| 49 |
+
text_column: report_text
|
| 50 |
+
label_column: subcategory
|
| 51 |
+
label_maps:
|
| 52 |
+
subcategory:
|
| 53 |
+
0: ATM Fraud
|
| 54 |
+
1: Abandoned Child
|
| 55 |
+
2: Abandoned Vehicle
|
| 56 |
+
3: Bank Robbery
|
| 57 |
+
4: Breaking and Entering
|
| 58 |
+
5: Child Labour
|
| 59 |
+
6: Consumer Fraud
|
| 60 |
+
7: Domestic Servitude
|
| 61 |
+
8: Domestic Violence
|
| 62 |
+
9: Drug Distribution
|
| 63 |
+
10: Extortion
|
| 64 |
+
11: Gunfire
|
| 65 |
+
12: Hit and Run
|
| 66 |
+
13: Identity Theft
|
| 67 |
+
14: Illicit Brewing
|
| 68 |
+
15: Missing Child
|
| 69 |
+
16: Mugging
|
| 70 |
+
17: Officer Commendation
|
| 71 |
+
18: Phone Scam
|
| 72 |
+
19: Property Destruction
|
| 73 |
+
20: Robbery
|
| 74 |
+
21: Sexual Abuse
|
| 75 |
+
22: Tourist Scam
|
| 76 |
+
23: Vehicle Theft
|
| 77 |
+
- name: priority
|
| 78 |
+
type: single_label_classification
|
| 79 |
+
data_path: /home/naynek/Desktop/TujengeAI/Update/JengaAI/backend/uploads/datasets/16ced0930e7e_police_case_reports.json
|
| 80 |
+
heads:
|
| 81 |
+
- name: priority
|
| 82 |
+
num_labels: 4
|
| 83 |
+
weight: 1.0
|
| 84 |
+
dropout: 0.1
|
| 85 |
+
text_column: report_text
|
| 86 |
+
label_column: priority
|
| 87 |
+
label_maps:
|
| 88 |
+
priority:
|
| 89 |
+
0: critical
|
| 90 |
+
1: high
|
| 91 |
+
2: low
|
| 92 |
+
3: medium
|
| 93 |
+
- name: intervention
|
| 94 |
+
type: single_label_classification
|
| 95 |
+
data_path: /home/naynek/Desktop/TujengeAI/Update/JengaAI/backend/uploads/datasets/16ced0930e7e_police_case_reports.json
|
| 96 |
+
heads:
|
| 97 |
+
- name: intervention
|
| 98 |
+
num_labels: 8
|
| 99 |
+
weight: 1.0
|
| 100 |
+
dropout: 0.1
|
| 101 |
+
text_column: report_text
|
| 102 |
+
label_column: intervention
|
| 103 |
+
label_maps:
|
| 104 |
+
intervention:
|
| 105 |
+
0: Counseling
|
| 106 |
+
1: Investigation
|
| 107 |
+
2: Legal Aid
|
| 108 |
+
3: Medical
|
| 109 |
+
4: None Required
|
| 110 |
+
5: Police Dispatch
|
| 111 |
+
6: Search and Rescue
|
| 112 |
+
7: Welfare Services
|
| 113 |
+
- name: entity_extraction
|
| 114 |
+
type: ner
|
| 115 |
+
data_path: /home/naynek/Desktop/TujengeAI/Update/JengaAI/backend/uploads/datasets/16ced0930e7e_police_case_reports.json
|
| 116 |
+
heads:
|
| 117 |
+
- name: entity_extraction
|
| 118 |
+
num_labels: 15
|
| 119 |
+
weight: 1.0
|
| 120 |
+
dropout: 0.1
|
| 121 |
+
text_column: report_text
|
| 122 |
+
label_column: entities
|
| 123 |
+
label_maps:
|
| 124 |
+
ner_head:
|
| 125 |
+
0: O
|
| 126 |
+
1: B-DATE
|
| 127 |
+
2: I-DATE
|
| 128 |
+
3: B-LOCATION
|
| 129 |
+
4: I-LOCATION
|
| 130 |
+
5: B-NAME
|
| 131 |
+
6: I-NAME
|
| 132 |
+
7: B-ORG
|
| 133 |
+
8: I-ORG
|
| 134 |
+
9: B-TIME
|
| 135 |
+
10: I-TIME
|
| 136 |
+
11: B-VEHICLE
|
| 137 |
+
12: I-VEHICLE
|
| 138 |
+
13: B-WEAPON
|
| 139 |
+
14: I-WEAPON
|
| 140 |
+
model:
|
| 141 |
+
base_model: distilbert-base-uncased
|
| 142 |
+
hidden_size: 768
|
| 143 |
+
dropout: 0.1
|
| 144 |
+
fusion:
|
| 145 |
+
type: attention
|
| 146 |
+
dropout: 0.1
|
| 147 |
+
use_residual: true
|
| 148 |
+
num_attention_heads: 1
|
| 149 |
+
gate_init_value: 0.5
|
| 150 |
+
freeze_encoder_layers: 0
|
| 151 |
+
gradient_checkpointing: false
|
| 152 |
+
tokenizer:
|
| 153 |
+
max_length: 512
|
| 154 |
+
padding: max_length
|
| 155 |
+
truncation: true
|
| 156 |
+
training:
|
| 157 |
+
output_dir: ./results/police_case_reports_json
|
| 158 |
+
learning_rate: 2.0e-05
|
| 159 |
+
batch_size: 4
|
| 160 |
+
eval_batch_size: 4
|
| 161 |
+
num_epochs: 4
|
| 162 |
+
weight_decay: 0.01
|
| 163 |
+
warmup_steps: 50
|
| 164 |
+
max_grad_norm: 1.0
|
| 165 |
+
gradient_accumulation_steps: 1
|
| 166 |
+
use_amp: false
|
| 167 |
+
device: auto
|
| 168 |
+
task_sampling: round_robin
|
| 169 |
+
temperature: 2.0
|
| 170 |
+
early_stopping_patience: 3
|
| 171 |
+
metric_for_best_model: eval_loss
|
| 172 |
+
greater_is_better: false
|
| 173 |
+
logging:
|
| 174 |
+
service: mlflow
|
| 175 |
+
experiment_name: police_case_reports_json
|
| 176 |
+
tracking_uri: http://localhost:5000
|
| 177 |
+
log_every_n_steps: 10
|
| 178 |
+
checkpoint:
|
| 179 |
+
save_every_n_epochs: 1
|
| 180 |
+
save_best: true
|
| 181 |
+
max_checkpoints: 2
|
| 182 |
+
data:
|
| 183 |
+
test_size: 0.08
|
| 184 |
+
seed: 42
|
| 185 |
+
num_workers: 0
|
| 186 |
+
pin_memory: true
|
| 187 |
+
pii_redaction:
|
| 188 |
+
enabled: false
|
| 189 |
+
detect_types:
|
| 190 |
+
- email
|
| 191 |
+
- phone
|
| 192 |
+
- url
|
| 193 |
+
- card
|
| 194 |
+
- name
|
| 195 |
+
- org
|
| 196 |
+
log_detections: true
|
label_maps.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sentiment": {
|
| 3 |
+
"sentiment": {
|
| 4 |
+
"0": "negative",
|
| 5 |
+
"1": "neutral",
|
| 6 |
+
"2": "positive",
|
| 7 |
+
"3": "urgent"
|
| 8 |
+
}
|
| 9 |
+
},
|
| 10 |
+
"main_category": {
|
| 11 |
+
"main_category": {
|
| 12 |
+
"0": "Child Abuse",
|
| 13 |
+
"1": "Commendation",
|
| 14 |
+
"2": "Drug Abuse",
|
| 15 |
+
"3": "Fraud",
|
| 16 |
+
"4": "Human Trafficking",
|
| 17 |
+
"5": "Missing Person",
|
| 18 |
+
"6": "Theft",
|
| 19 |
+
"7": "Traffic",
|
| 20 |
+
"8": "Vandalism",
|
| 21 |
+
"9": "Violence"
|
| 22 |
+
}
|
| 23 |
+
},
|
| 24 |
+
"subcategory": {
|
| 25 |
+
"subcategory": {
|
| 26 |
+
"0": "ATM Fraud",
|
| 27 |
+
"1": "Abandoned Child",
|
| 28 |
+
"2": "Abandoned Vehicle",
|
| 29 |
+
"3": "Bank Robbery",
|
| 30 |
+
"4": "Breaking and Entering",
|
| 31 |
+
"5": "Child Labour",
|
| 32 |
+
"6": "Consumer Fraud",
|
| 33 |
+
"7": "Domestic Servitude",
|
| 34 |
+
"8": "Domestic Violence",
|
| 35 |
+
"9": "Drug Distribution",
|
| 36 |
+
"10": "Extortion",
|
| 37 |
+
"11": "Gunfire",
|
| 38 |
+
"12": "Hit and Run",
|
| 39 |
+
"13": "Identity Theft",
|
| 40 |
+
"14": "Illicit Brewing",
|
| 41 |
+
"15": "Missing Child",
|
| 42 |
+
"16": "Mugging",
|
| 43 |
+
"17": "Officer Commendation",
|
| 44 |
+
"18": "Phone Scam",
|
| 45 |
+
"19": "Property Destruction",
|
| 46 |
+
"20": "Robbery",
|
| 47 |
+
"21": "Sexual Abuse",
|
| 48 |
+
"22": "Tourist Scam",
|
| 49 |
+
"23": "Vehicle Theft"
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"priority": {
|
| 53 |
+
"priority": {
|
| 54 |
+
"0": "critical",
|
| 55 |
+
"1": "high",
|
| 56 |
+
"2": "low",
|
| 57 |
+
"3": "medium"
|
| 58 |
+
}
|
| 59 |
+
},
|
| 60 |
+
"intervention": {
|
| 61 |
+
"intervention": {
|
| 62 |
+
"0": "Counseling",
|
| 63 |
+
"1": "Investigation",
|
| 64 |
+
"2": "Legal Aid",
|
| 65 |
+
"3": "Medical",
|
| 66 |
+
"4": "None Required",
|
| 67 |
+
"5": "Police Dispatch",
|
| 68 |
+
"6": "Search and Rescue",
|
| 69 |
+
"7": "Welfare Services"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"entity_extraction": {
|
| 73 |
+
"ner_head": {
|
| 74 |
+
"0": "O",
|
| 75 |
+
"1": "B-DATE",
|
| 76 |
+
"2": "I-DATE",
|
| 77 |
+
"3": "B-LOCATION",
|
| 78 |
+
"4": "I-LOCATION",
|
| 79 |
+
"5": "B-NAME",
|
| 80 |
+
"6": "I-NAME",
|
| 81 |
+
"7": "B-ORG",
|
| 82 |
+
"8": "I-ORG",
|
| 83 |
+
"9": "B-TIME",
|
| 84 |
+
"10": "I-TIME",
|
| 85 |
+
"11": "B-VEHICLE",
|
| 86 |
+
"12": "I-VEHICLE",
|
| 87 |
+
"13": "B-WEAPON",
|
| 88 |
+
"14": "I-WEAPON"
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
}
|
metadata.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model": "distilbert-base-uncased",
|
| 3 |
+
"hidden_size": 768,
|
| 4 |
+
"num_tasks": 6,
|
| 5 |
+
"task_names": [
|
| 6 |
+
"sentiment",
|
| 7 |
+
"main_category",
|
| 8 |
+
"subcategory",
|
| 9 |
+
"priority",
|
| 10 |
+
"intervention",
|
| 11 |
+
"entity_extraction"
|
| 12 |
+
],
|
| 13 |
+
"task_types": [
|
| 14 |
+
"sentiment",
|
| 15 |
+
"single_label_classification",
|
| 16 |
+
"single_label_classification",
|
| 17 |
+
"single_label_classification",
|
| 18 |
+
"single_label_classification",
|
| 19 |
+
"ner"
|
| 20 |
+
],
|
| 21 |
+
"has_fusion": true
|
| 22 |
+
}
|
model.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a29701fc9e837a557fd5b08f640ce9bff8876f6e34a933e4614346dfd4b38d4d
|
| 3 |
+
size 270439507
|