File size: 2,689 Bytes
13691ee
7c24a3d
13691ee
 
 
 
 
7c24a3d
13691ee
 
7c24a3d
 
3f55b1c
fb4a723
7c24a3d
 
 
 
3f55b1c
7c24a3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a726962
 
7234408
a726962
 
 
 
a715efd
a726962
 
 
 
7c24a3d
 
dfd58cd
7c24a3d
dfd58cd
7c24a3d
dfd58cd
7c24a3d
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
---
'[object Object]': null
license: llama3.1
language:
- de
base_model:
- spacy/de_core_news_lg
- meta-llama/Llama-3.1-8B-Instruct
---

### Model Description

This is a spaCy model fine-tuned to extract names of cities and municipalities from German news articles. It was trained on 50,000 LLM-annotated [(LLAMA 3.1 8B-Instruct)](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) German news articles from the CommonCrawl news dataset.
This is still work in progress. Please report any bugs in the community tab.
- **Developed by:** Lukas Kriesch
- **Model type:** Named Entity Recognition (NER)
- **Language(s) (NLP):** German
- **License:** Llama 3.1 Community License Agreement
- **Finetuned from model :** [spacy/de_core_news_lg](https://huggingface.co/spacy/de_core_news_lg)

## Uses

### Direct Use
This model can be directly used to extract city and municipality names from any German-language text source, particularly news articles. Researchers and developers working in geospatial analysis or regional studies may find this useful for location-based analyses.

### Downstream Use

Fine-tuned applications might involve integration into larger workflows for geospatial data processing, population studies, regional analysis, or sentiment analysis in the context of location data.

### Out-of-Scope Use
The model should not be used to infer broader geographical trends or to analyze texts unrelated to city or municipal locations in Germany. Additionally, it may not perform well on non-news domains or texts that lack clear references to cities or municipalities.

## Bias, Risks, and Limitations

The model is trained specifically on German news articles and may not generalize well to other domains such as social media, legal texts, or scientific literature. Additionally, there may be biases in the training data, particularly if certain regions are underrepresented in the dataset. Users should be cautious about the model's performance across different subpopulations of city or location mentions (e.g., historical names or rare municipalities).

## How to Get Started with the Model
Install SpaCy: https://spacy.io/usage
Install pretrained vectors: https://spacy.io/models/de#de_core_news_lg

Download https://huggingface.co/LKriesch/LLAMA_fast_geotag/tree/main/spacy_lg_geo
```
import spacy
nlp=spacy.load("path_to_model")
text="Das Olympiastadion steht in Berlin."
doc=nlp(text)
for ent in doc.ents:
    print(f"Entity: {ent.text}, Label: {ent.label_}")
```
#### Training Hyperparameters
Batch size: 64

Epochs: Up to 100, with early stopping (patience of 3 epochs)

Optimizer: Default spaCy optimizer for NER fine-tuning

Training regime: Mixed precision (fp16)