Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Analysing and Mitigating Origin Bias in German Word Embeddings
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aileen Reichelt
Analysing and Mitigating Origin Bias in German Word Embeddings
Commits
7e9f3739
Commit
7e9f3739
authored
1 year ago
by
Aileen Reichelt
Browse files
Options
Downloads
Patches
Plain Diff
Add script to count deepset GloVe vocab
parent
bb4d93f9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
analyze_deepset_glove_counts.py
+23
-0
23 additions, 0 deletions
analyze_deepset_glove_counts.py
with
23 additions
and
0 deletions
analyze_deepset_glove_counts.py
0 → 100644
+
23
−
0
View file @
7e9f3739
"""
Analyze the vocab counts and positions of the name lists
within Deepset
'
s German pretrained GloVe embeddings.
"""
import
pandas
as
pd
vocab_df
=
pd
.
read_csv
(
"
./data/deepset_german_glove_vocab.txt
"
,
sep
=
"
"
,
header
=
None
,
names
=
[
"
word
"
,
"
count
"
])
names_df
=
pd
.
read_csv
(
"
./data/names_nationality.csv
"
)
names_df
[
"
deepset_glove_vocab_count
"
]
=
0
names_df
[
"
deepset_glove_vocab_position
"
]
=
-
1
for
index
,
row
in
names_df
.
iterrows
():
name
=
row
[
'
name
'
].
lower
()
search_result
=
vocab_df
.
loc
[
vocab_df
[
"
word
"
]
==
name
].
head
(
1
)
if
not
search_result
.
empty
:
count_value
=
search_result
[
"
count
"
].
iloc
[
0
]
index_value
=
search_result
.
index
[
0
]
names_df
.
at
[
index
,
"
deepset_glove_vocab_count
"
]
=
count_value
names_df
.
at
[
index
,
"
deepset_glove_vocab_position
"
]
=
index_value
names_df
.
to_csv
(
"
./data/names_nationality_deepset.csv
"
,
index
=
False
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment