Sanadshabann commited on
Commit
2da888b
·
verified ·
1 Parent(s): 1c05f69

Upload AGS model from .pt checkpoint (contiguous tensors)

Browse files
README.md ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ar
4
+ library_name: transformers
5
+ pipeline_tag: text-classification
6
+ tags:
7
+ - regression
8
+ - arabic
9
+ - dialectness
10
+ - AGS
11
+ base_model: CAMeL-Lab/bert-base-arabic-camelbert-mix
12
+ license: apache-2.0
13
+ ---
14
+
15
+ # Sanadshabann/AGS — Arabic Generality Score (AGS)
16
+
17
+ Predicts a continuous **generality** score for a target word in context.
18
+ Wrap the target span with `[TGT] ... [/TGT]`.
19
+
20
+ ## Usage
21
+ ```python
22
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
23
+ import torch
24
+ tok = AutoTokenizer.from_pretrained("Sanadshabann/AGS", use_fast=True)
25
+ model = AutoModelForSequenceClassification.from_pretrained("Sanadshabann/AGS").eval()
26
+ text = "هذا مثال مع [TGT]الكلمة[/TGT] الهدف داخل الجملة."
27
+ with torch.inference_mode():
28
+ score = model(**tok(text, return_tensors="pt", truncation=True)).logits.squeeze().item()
29
+ print("generality:", float(score))
30
+ Notes: problem_type=regression, num_labels=1. Evaluated with RMSE.
added_tokens.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "[/TGT]": 30001,
3
+ "[TGT]": 30000
4
+ }
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "CAMeL-Lab/bert-base-arabic-camelbert-mix",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "generality"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "label2id": {
18
+ "generality": 0
19
+ },
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 12,
24
+ "num_hidden_layers": 12,
25
+ "pad_token_id": 0,
26
+ "position_embedding_type": "absolute",
27
+ "problem_type": "regression",
28
+ "torch_dtype": "float32",
29
+ "transformers_version": "4.43.4",
30
+ "type_vocab_size": 2,
31
+ "use_cache": true,
32
+ "vocab_size": 30002
33
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51b7f66a072d76f2cd3a20b89da402a20a3e4162c01aae36056fa6114258fda1
3
+ size 436358124
special_tokens_map.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "[TGT]",
4
+ "[/TGT]"
5
+ ],
6
+ "cls_token": {
7
+ "content": "[CLS]",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "mask_token": {
14
+ "content": "[MASK]",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "pad_token": {
21
+ "content": "[PAD]",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "sep_token": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ },
34
+ "unk_token": {
35
+ "content": "[UNK]",
36
+ "lstrip": false,
37
+ "normalized": false,
38
+ "rstrip": false,
39
+ "single_word": false
40
+ }
41
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "30000": {
44
+ "content": "[TGT]",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "30001": {
52
+ "content": "[/TGT]",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ }
59
+ },
60
+ "additional_special_tokens": [
61
+ "[TGT]",
62
+ "[/TGT]"
63
+ ],
64
+ "clean_up_tokenization_spaces": true,
65
+ "cls_token": "[CLS]",
66
+ "do_basic_tokenize": true,
67
+ "do_lower_case": false,
68
+ "extra_special_tokens": {},
69
+ "full_tokenizer_file": null,
70
+ "mask_token": "[MASK]",
71
+ "model_max_length": 1000000000000000019884624838656,
72
+ "never_split": null,
73
+ "pad_token": "[PAD]",
74
+ "sep_token": "[SEP]",
75
+ "strip_accents": null,
76
+ "tokenize_chinese_chars": true,
77
+ "tokenizer_class": "BertTokenizer",
78
+ "unk_token": "[UNK]"
79
+ }
training_args.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "exported_at_utc": "2025-11-02T12:37:21Z",
3
+ "task": "regression (generality score)",
4
+ "language": "ar",
5
+ "base_model": "CAMeL-Lab/bert-base-arabic-camelbert-mix",
6
+ "uses_special_tokens": [
7
+ "[TGT]",
8
+ "[/TGT]"
9
+ ]
10
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff