LennardZuendorf commited on
Commit
278b236
·
1 Parent(s): fcf805a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -44
README.md CHANGED
@@ -7,21 +7,37 @@ tags:
7
  - text-classification
8
  model_format: pickle
9
  model_file: legalis-scikit.pkl
 
 
 
 
 
 
 
10
  ---
11
 
12
  # Model description
13
 
14
- [More Information Needed]
15
 
16
  ## Intended uses & limitations
17
 
18
- [More Information Needed]
19
 
20
- ## Training Procedure
21
 
22
- [More Information Needed]
23
 
24
- ### Hyperparameters
 
 
 
 
 
 
 
 
 
25
 
26
  <details>
27
  <summary> Click to expand </summary>
@@ -73,7 +89,7 @@ model_file: legalis-scikit.pkl
73
 
74
  ### Model Plot
75
 
76
- <style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id="sk-container-id-1" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>Pipeline(steps=[(&#x27;count&#x27;,CountVectorizer(ngram_range=(1, 3),stop_words=[&#x27;aber&#x27;, &#x27;alle&#x27;, &#x27;allem&#x27;, &#x27;allen&#x27;,&#x27;aller&#x27;, &#x27;alles&#x27;, &#x27;als&#x27;, &#x27;also&#x27;,&#x27;am&#x27;, &#x27;an&#x27;, &#x27;ander&#x27;, &#x27;andere&#x27;,&#x27;anderem&#x27;, &#x27;anderen&#x27;, &#x27;anderer&#x27;,&#x27;anderes&#x27;, &#x27;anderm&#x27;, &#x27;andern&#x27;,&#x27;anderr&#x27;, &#x27;anders&#x27;, &#x27;auch&#x27;, &#x27;auf&#x27;,&#x27;aus&#x27;, &#x27;bei&#x27;, &#x27;bin&#x27;, &#x27;bis&#x27;, &#x27;bist&#x27;,&#x27;da&#x27;, &#x27;damit&#x27;, &#x27;dann&#x27;, ...])),(&#x27;clf&#x27;,RandomForestClassifier(min_samples_split=5, random_state=0))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class="sk-container" hidden><div class="sk-item sk-dashed-wrapped"><div class="sk-label-container"><div class="sk-label sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-1" type="checkbox" ><label for="sk-estimator-id-1" class="sk-toggleable__label sk-toggleable__label-arrow">Pipeline</label><div class="sk-toggleable__content"><pre>Pipeline(steps=[(&#x27;count&#x27;,CountVectorizer(ngram_range=(1, 3),stop_words=[&#x27;aber&#x27;, &#x27;alle&#x27;, &#x27;allem&#x27;, &#x27;allen&#x27;,&#x27;aller&#x27;, &#x27;alles&#x27;, &#x27;als&#x27;, &#x27;also&#x27;,&#x27;am&#x27;, &#x27;an&#x27;, &#x27;ander&#x27;, &#x27;andere&#x27;,&#x27;anderem&#x27;, &#x27;anderen&#x27;, &#x27;anderer&#x27;,&#x27;anderes&#x27;, &#x27;anderm&#x27;, &#x27;andern&#x27;,&#x27;anderr&#x27;, &#x27;anders&#x27;, &#x27;auch&#x27;, &#x27;auf&#x27;,&#x27;aus&#x27;, &#x27;bei&#x27;, &#x27;bin&#x27;, &#x27;bis&#x27;, &#x27;bist&#x27;,&#x27;da&#x27;, &#x27;damit&#x27;, &#x27;dann&#x27;, ...])),(&#x27;clf&#x27;,RandomForestClassifier(min_samples_split=5, random_state=0))])</pre></div></div></div><div class="sk-serial"><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-2" type="checkbox" ><label for="sk-estimator-id-2" class="sk-toggleable__label sk-toggleable__label-arrow">CountVectorizer</label><div class="sk-toggleable__content"><pre>CountVectorizer(ngram_range=(1, 3),stop_words=[&#x27;aber&#x27;, &#x27;alle&#x27;, &#x27;allem&#x27;, &#x27;allen&#x27;, &#x27;aller&#x27;, &#x27;alles&#x27;,&#x27;als&#x27;, &#x27;also&#x27;, &#x27;am&#x27;, &#x27;an&#x27;, &#x27;ander&#x27;, &#x27;andere&#x27;,&#x27;anderem&#x27;, &#x27;anderen&#x27;, &#x27;anderer&#x27;, &#x27;anderes&#x27;,&#x27;anderm&#x27;, &#x27;andern&#x27;, &#x27;anderr&#x27;, &#x27;anders&#x27;, &#x27;auch&#x27;,&#x27;auf&#x27;, &#x27;aus&#x27;, &#x27;bei&#x27;, &#x27;bin&#x27;, &#x27;bis&#x27;, &#x27;bist&#x27;, &#x27;da&#x27;,&#x27;damit&#x27;, &#x27;dann&#x27;, ...])</pre></div></div></div><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-3" type="checkbox" ><label for="sk-estimator-id-3" class="sk-toggleable__label sk-toggleable__label-arrow">RandomForestClassifier</label><div class="sk-toggleable__content"><pre>RandomForestClassifier(min_samples_split=5, random_state=0)</pre></div></div></div></div></div></div></div>
77
 
78
  ## Evaluation Results
79
 
@@ -82,48 +98,14 @@ model_file: legalis-scikit.pkl
82
  | accuracy | 0.664286 |
83
  | f1 score | 0.664286 |
84
 
85
- # How to Get Started with the Model
86
-
87
- [More Information Needed]
88
 
89
  # Model Card Authors
90
 
91
- This model card is written by following authors:
92
-
93
- [More Information Needed]
94
-
95
- # Model Card Contact
96
 
97
- You can contact the model card authors through following channels:
98
- [More Information Needed]
99
 
100
  # Citation
101
 
102
- Below you can find information related to citation.
103
-
104
- **BibTeX:**
105
- ```
106
- [More Information Needed]
107
- ```
108
-
109
- # get_started_code
110
-
111
- import pickle
112
- with open(dtc_pkl_filename, 'rb') as file:
113
- clf = pickle.load(file)
114
-
115
- # model_card_authors
116
-
117
- LennardZuendorf
118
-
119
- # limitations
120
-
121
- This model is not ready to be used in production.
122
-
123
- # model_description
124
-
125
- This is a RandomForestClassifier model trained a dataset of legal cases to predict the outcome as a binary value.
126
-
127
- # eval_method
128
-
129
- The model is evaluated using test split, on accuracy and F1 score with macro average.
 
7
  - text-classification
8
  model_format: pickle
9
  model_file: legalis-scikit.pkl
10
+ datasets:
11
+ - LennardZuendorf/legalis
12
+ language:
13
+ - de
14
+ metrics:
15
+ - accuracy
16
+ - f1
17
  ---
18
 
19
  # Model description
20
 
21
+ This is a tuned random forest classifiert, trained on a processed dataset of 2800 German court cases (see [legalis dataset](https://huggingface.co/datasets/LennardZuendorf/legalis)). It predicts the winner (defended/"Verklagt*r" or plaintiff/"Kläger*in") of a court case based on facts provided (in German).
22
 
23
  ## Intended uses & limitations
24
 
25
+ - This model was created as part of a university project and should be considered highly experimental.
26
 
27
+ ## get started with the model
28
 
29
+ Try out the hosted Interference UI or the [Huggingface Space](https://huggingface.co/spaces/LennardZuendorf/legalis)
30
 
31
+ ```
32
+ import pickle
33
+ with open(dtc_pkl_filename, 'rb') as file:
34
+ clf = pickle.load(file)
35
+ ```
36
+
37
+
38
+ ### The modelHyperparameters
39
+
40
+ - The Classifier was tuned with scikit's cv search method, the pipeline used a CountVectorizer with common German stopwords.
41
 
42
  <details>
43
  <summary> Click to expand </summary>
 
89
 
90
  ### Model Plot
91
 
92
+ <style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 5;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: "▸";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: "▾";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: "";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: "";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id="sk-container-id-1" class="sk-top-container" style="overflow: auto;"><div class="sk-text-repr-fallback"><pre>Pipeline(steps=[(&#x27;count&#x27;,CountVectorizer(ngram_range=(1, 3),stop_words=[&#x27;aber&#x27;, &#x27;alle&#x27;, &#x27;allem&#x27;, &#x27;allen&#x27;,&#x27;aller&#x27;, &#x27;alles&#x27;, &#x27;als&#x27;, &#x27;also&#x27;,&#x27;am&#x27;, &#x27;an&#x27;, &#x27;ander&#x27;, &#x27;andere&#x27;,&#x27;anderem&#x27;, &#x27;anderen&#x27;, &#x27;anderer&#x27;,&#x27;anderes&#x27;, &#x27;anderm&#x27;, &#x27;andern&#x27;,&#x27;anderr&#x27;, &#x27;anders&#x27;, &#x27;auch&#x27;, &#x27;auf&#x27;,&#x27;aus&#x27;, &#x27;bei&#x27;, &#x27;bin&#x27;, &#x27;bis&#x27;, &#x27;bist&#x27;,&#x27;da&#x27;, &#x27;damit&#x27;, &#x27;dann&#x27;, ...])),(&#x27;clf&#x27;,RandomForestClassifier(min_samples_split=5, random_state=0))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class="sk-container" hidden><div class="sk-item sk-dashed-wrapped"><div class="sk-label-container"><div class="sk-label sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-1" type="checkbox" ><label for="sk-estimator-id-1" class="sk-toggleable__label sk-toggleable__label-arrow">Pipeline</label><div class="sk-toggleable__content"><pre>Pipeline(steps=[(&#x27;count&#x27;,CountVectorizer(ngram_range=(1, 3),stop_words=[&#x27;aber&#x27;, &#x27;alle&#x27;, &#x27;allem&#x27;, &#x27;allen&#x27;,&#x27;aller&#x27;, &#x27;alles&#x27;, &#x27;als&#x27;, &#x27;also&#x27;,&#x27;am&#x27;, &#x27;an&#x27;, &#x27;ander&#x27;, &#x27;andere&#x27;,&#x27;anderem&#x27;, &#x27;anderen&#x27;, &#x27;anderer&#x27;,&#x27;anderes&#x27;, &#x27;anderm&#x27;, &#x27;andern&#x27;,&#x27;anderr&#x27;, &#x27;anders&#x27;, &#x27;auch&#x27;, &#x27;auf&#x27;,&#x27;aus&#x27;, &#x27;bei&#x27;, &#x27;bin&#x27;, &#x27;bis&#x27;, &#x27;bist&#x27;,&#x27;da&#x27;, &#x27;damit&#x27;, &#x27;dann&#x27;, ...])),(&#x27;clf&#x27;,RandomForestClassifier(min_samples_split=5, random_state=0))])</pre></div></div></div><div class="sk-serial"><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-2" type="checkbox" ><label for="sk-estimator-id-2" class="sk-toggleable__label sk-toggleable__label-arrow">CountVectorizer</label><div class="sk-toggleable__content"><pre>CountVectorizer(ngram_range=(1, 3),stop_words=[&#x27;aber&#x27;, &#x27;alle&#x27;, &#x27;allem&#x27;, &#x27;allen&#x27;, &#x27;aller&#x27;, &#x27;alles&#x27;,&#x27;als&#x27;, &#x27;also&#x27;, &#x27;am&#x27;, &#x27;an&#x27;, &#x27;ander&#x27;, &#x27;andere&#x27;,&#x27;anderem&#x27;, &#x27;anderen&#x27;, &#x27;anderer&#x27;, &#x27;anderes&#x27;,&#x27;anderm&#x27;, &#x27;andern&#x27;, &#x27;anderr&#x27;, &#x27;anders&#x27;, &#x27;auch&#x27;,&#x27;auf&#x27;, &#x27;aus&#x27;, &#x27;bei&#x27;, &#x27;bin&#x27;, &#x27;bis&#x27;, &#x27;bist&#x27;, &#x27;da&#x27;,&#x27;damit&#x27;, &#x27;dann&#x27;, ...])</pre></div></div></div><div class="sk-item"><div class="sk-estimator sk-toggleable"><input class="sk-toggleable__control sk-hidden--visually" id="sk-estimator-id-3" type="checkbox" ><label for="sk-estimator-id-3" class="sk-toggleable__label sk-toggleable__label-arrow">RandomForestClassifier</label><div class="sk-toggleable__content"><pre>RandomForestClassifier(min_samples_split=5, random_state=0)</pre></div></div></div></div></div></div></div>
93
 
94
  ## Evaluation Results
95
 
 
98
  | accuracy | 0.664286 |
99
  | f1 score | 0.664286 |
100
 
 
 
 
101
 
102
  # Model Card Authors
103
 
104
+ This model card and the model itself are written by following authors:
 
 
 
 
105
 
106
+ [@LennardZuendorf -HGF](https://huggingface.co/LennardZuendorf)
107
+ [@LennardZuendorf - Github](https://github.com/LennardZuendorf)
108
 
109
  # Citation
110
 
111
+ See Dataset for Sources and refer to [Github](https://github.com/LennardZuendorf/uniArchive-legalis) for collection of all files.