ilsp
/

pprokopidis commited on
Commit
36af7e1
·
verified ·
1 Parent(s): f273319

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -0
README.md CHANGED
@@ -9,6 +9,8 @@ pipeline_tag: text-classification
9
 
10
  # ilsp/justice
11
 
 
 
12
  ```python
13
  repo_id = "ilsp/justice"
14
  model_path = hf_hub_download(repo_id=repo_id, filename="20241124-model.ftz")
@@ -34,3 +36,32 @@ for line in text.split(NL):
34
  line = line[0:nchars]
35
  print(f"{line} -> {pred}")
36
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  # ilsp/justice
11
 
12
+ ## Paragraph classification in Greek court decisions
13
+
14
  ```python
15
  repo_id = "ilsp/justice"
16
  model_path = hf_hub_download(repo_id=repo_id, filename="20241124-model.ftz")
 
36
  line = line[0:nchars]
37
  print(f"{line} -> {pred}")
38
  ```
39
+
40
+ ## Named entity recognition in paragraphs with litigant names and addresses
41
+ ```python
42
+ from flair.data import Sentence, Token
43
+ from flair.models import SequenceTagger
44
+ from huggingface_hub import hf_hub_download
45
+
46
+ REPO_ID = "ilsp/justice"
47
+ MODEL_PATH = "litigant-ner-model.pt"
48
+ model_path = hf_hub_download(repo_id=REPO_ID, filename=MODEL_PATH)
49
+ model = SequenceTagger.load(model_path)
50
+
51
+ text = "Για να δικάσει την από 30 Μαρτίου 2020 έφεση των 1) Νίκης Νικίδου του Νίκου , κατοίκου Νίκαιας ( Νεάπολης 1 ) , 2) Άννας Άννίδου του Άνθιμου , κατοίκου Αθήνας ( Αγράμπελης 1 ) και 3) Σοφίας Σοφίδου του Σοφοκλή , κατοίκου Στυλίδας ( Στρυμώνος 1 ) , οι οποίοι παρέστησαν με τον δικηγόρο Λυσία Λυσίου ( Α.Μ. 12341 ) , που τον διόρισαν με πληρεξούσιο ."
52
+ sentence = Sentence([Token(t) for t in text.split()]) # or use a sentence splitter
53
+ model.predict(sentence)
54
+ sentence.get_spans("ner")
55
+
56
+ ```
57
+ ```
58
+ [Span[11:13]: "Νίκης Νικίδου" → anon_name (1.0),
59
+ Span[14:15]: "Νίκου" → anon_name (1.0),
60
+ Span[19:21]: "Νεάπολης 1" → anon_other (1.0),
61
+ Span[24:26]: "Άννας Άννίδου" → anon_name (1.0),
62
+ Span[27:28]: "Άνθιμου" → anon_name (1.0),
63
+ Span[32:34]: "Αγράμπελης 1" → anon_other (1.0),
64
+ Span[37:39]: "Σοφίας Σοφίδου" → anon_name (1.0),
65
+ Span[40:41]: "Σοφοκλή" → anon_name (1.0),
66
+ Span[45:47]: "Στρυμώνος 1" → anon_other (1.0)]
67
+ ```