Datasets:
Tasks:
Sentence Similarity
Formats:
csv
Languages:
German
Size:
10M - 100M
ArXiv:
Tags:
sentence-transformers
License:
add Anomalies
Browse files
README.md
CHANGED
@@ -54,6 +54,27 @@ For us it has proven useful to delete the following pairs of sentences:
|
|
54 |
- **`en_de_token_count`**: number of tokens of the `de` text, tokenized with [deepset/gbert-large](https://huggingface.co/deepset/gbert-large)
|
55 |
- **`cos_sim`**: the [cosine similarity](https://en.wikipedia.org/wiki/Cosine_similarity) of both sentences measured with [sentence-transformers/paraphrase-multilingual-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2)
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
## Parallel text corpora used
|
58 |
| Corpus name & link | Number of paraphrases |
|
59 |
|-----------------------------------------------------------------------|----------------------:|
|
|
|
54 |
- **`en_de_token_count`**: number of tokens of the `de` text, tokenized with [deepset/gbert-large](https://huggingface.co/deepset/gbert-large)
|
55 |
- **`cos_sim`**: the [cosine similarity](https://en.wikipedia.org/wiki/Cosine_similarity) of both sentences measured with [sentence-transformers/paraphrase-multilingual-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2)
|
56 |
|
57 |
+
## Anomalies in the texts
|
58 |
+
It is noticeable that the [OpenSubtitles](https://opus.nlpl.eu/OpenSubtitles-v2018.php) texts have weird dash prefixes. This looks like this:
|
59 |
+
|
60 |
+
```
|
61 |
+
- Hast du was draufgetan?
|
62 |
+
```
|
63 |
+
|
64 |
+
To remove them you could apply this function:
|
65 |
+
|
66 |
+
```python
|
67 |
+
import re
|
68 |
+
|
69 |
+
def clean_text(text):
|
70 |
+
text = re.sub("^[-\s]*", "", text)
|
71 |
+
text = re.sub("[-\s]*$", "", text)
|
72 |
+
return text
|
73 |
+
|
74 |
+
df["de"] = df["de"].apply(clean_text)
|
75 |
+
df["en_de"] = df["en_de"].apply(clean_text)
|
76 |
+
```
|
77 |
+
|
78 |
## Parallel text corpora used
|
79 |
| Corpus name & link | Number of paraphrases |
|
80 |
|-----------------------------------------------------------------------|----------------------:|
|