File size: 2,187 Bytes
5aa1246
 
 
 
1adbffe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42cadd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1adbffe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
language:
- en
---
# u2t01-bert-pos

## Training Data

* **Dataset:** `universal-dependencies/universal_dependencies` (Config: `en_ewt`)

* **Base Model:** `bert-base-uncased`

* **Hyperparameters:**

  * `head_lr`: 1e-3

  * `body_lr`: 2e-5

  * `seed`: 42

* **Tokenization & Tagging Strategy:**

  * 17 UPOS tags

  * First-subword labeling

  * `-100` mask for continuation and special tokens

## Metrics

```json
{
  "loss": 0.20879080891609192,
  "token_accuracy": 0.9718864323206616,
  "macro_f1": 0.9194535916196505,
  "precision": 0.9664863944129796,
  "recall": 0.9677226794013559,
  "f1": 0.9671041418101243,
  "runtime": 4.9848,
  "samples_per_second": 401.418,
  "steps_per_second": 3.21,
  "epoch": 3.0,
  "method": "full",
  "trainable_params": 108904721,
  "total_train_seconds": 309.63132905960083
}
```

**Headline Metrics:** Token Accuracy = **0.9719** | Macro-F1 = **0.9195**

## Example Usage
```python
from transformers import pipeline

# 1. Load the POS tagger pipeline
pos_tagger = pipeline(
    task="token-classification",
    model="Elpapudex/Pos-full",
    aggregation_strategy="simple"
)

# 2. Input sentence to analyze
text = "The quick brown fox jumps gracefully over the lazy dog."

# 3. Predict POS tags
results = pos_tagger(text)

# 4. Display results
for tag in results:
    print(f"Word: {tag['word']:<12} | Tag: {tag['entity_group']:<9} | Confidence: {tag['score']:.2%}")
```

## Limitations

* English-only.

* Trained on UD English EWT (English Web Treebank).

* Predicts only the 17 Universal POS (UPOS) tags.

* May not generalize well to other domains, genres, or tokenizers.

* *Note:* The `seqeval` precision, recall, and F1 values included in the JSON are sequence evaluation metrics and do not represent standard entity-level metrics for POS tagging.

## References

* Devlin et al., *BERT*, [arXiv:1810.04805 §5.3](https://arxiv.org/abs/1810.04805?utm_source=gemini)

* [Hugging Face Transformers Training Documentation](https://huggingface.co/docs/transformers/training?utm_source=gemini)

* [Hugging Face Universal Dependencies Dataset](https://huggingface.co/datasets/universal-dependencies/universal_dependencies?utm_source=gemini)