Browse Source

Updated bias script and added new yaml files

master
Chris Mahoney 2 years ago
parent
commit
1ca7407223
  1. 72
      bias.py
  2. BIN
      chinese_old.yaml
  3. 93
      old_files/bias.py
  4. 0
      old_files/bias_old.py
  5. 88
      old_files/en.py
  6. 88
      old_files/zh.py
  7. 38
      yamls/en.yaml
  8. 58
      yamls/esf.yaml
  9. 58
      yamls/esm.yaml
  10. 58
      yamls/fa.yaml
  11. 41
      yamls/frf.yaml
  12. 43
      yamls/frm.yaml
  13. BIN
      yamls/zh.yaml

72
bias.py

@ -1,16 +1,14 @@
import numpy as np
from sklearn.decomposition import PCA
#!/bin/env python3
import sys
from wikipedia2vec import Wikipedia2Vec
import argparse
import logging
WORD_PAIRS1 = [["woman", "man"], ["daughter", "son"], ["mother", "father"], ["girl", "boy"], ["queen", "king"], ["wife", "husband"], ["madam", "sir"]]
WORD_PAIRS1_FLAT = ["woman", "man", "daughter", "son", "mother", "father", "girl", "boy", "queen", "king", "wife", "husband", "madam", "sir"]
NEUTRAL_WORDS1 = ['nurse', 'teacher', 'writer', 'engineer', 'scientist', 'manager', 'driver', 'banker', 'electrician', 'bartender', 'musician', 'artist', 'chef', 'filmmaker', 'judge', 'comedian', 'inventor', 'worker', 'soldier', 'journalist']
WORD_PAIRS2 = [["woman", "man"], ["daughter", "son"], ["mother", "father"], ["girl", "boy"], ["queen", "king"], ["wife", "husband"], ["madam", "sir"], ["she", "he"], ["her", "his"], ["mary", "john"], ["herself", "himself"], ["gal", "guy"], ["female", "male"]]
WORD_PAIRS2_FLAT = ["woman", "man", "daughter", "son", "mother", "father", "girl", "boy", "queen", "king", "wife", "husband", "madam", "sir", "she", "he", "her", "his", "mary", "john", "herself", "himself", "gal", "guy", "female", "male"]
NEUTRAL_WORDS2 = ["actor","accountant","acquaintance","actor","actress","adjunct_professor","administrator","adventurer","advocate","aide","alderman","alter_ego","ambassador","analyst","anthropologist","archaeologist","archbishop","architect","artist","artiste","assassin","assistant_professor","associate_dean","associate_professor","astronaut","astronomer","athlete","athletic_director","attorney","author","baker","ballerina","ballplayer","banker","barber","baron","barrister","bartender","biologist","bishop","bodyguard","bookkeeper","boss","boxer","broadcaster","broker","bureaucrat","businessman","businesswoman","butcher","butler","cab_driver","cabbie","cameraman","campaigner","captain","cardiologist","caretaker","carpenter","cartoonist","cellist","chancellor","chaplain","character","chef","chemist","choreographer","cinematographer","citizen","civil_servant","cleric","clerk","coach","collector","colonel","columnist","comedian","comic","commander","commentator","commissioner","composer","conductor","confesses","congressman","constable","consultant","cop","correspondent","councilman","councilor","counselor","critic","crooner","crusader","curator","custodian","dad","dancer","dean","dentist","deputy","dermatologist","detective","diplomat","director","disc_jockey","doctor","doctoral_student","drug_addict","drummer","economics_professor","economist","editor","educator","electrician","employee","entertainer","entrepreneur","environmentalist","envoy","epidemiologist","evangelist","farmer","fashion_designer","fighter_pilot","filmmaker","financier","firebrand","firefighter","fireman","fisherman","footballer","foreman","freelance_writer","gangster","gardener","geologist","goalkeeper","graphic_designer","guidance_counselor","guitarist","hairdresser","handyman","headmaster","historian","hitman","homemaker","hooker","housekeeper","house-wife","illustrator","industrialist","infielder","inspector","instructor","interior_designer","inventor","investigator","investment_banker","janitor","jeweler","journalist","judge","jurist","laborer","landlord","lawmaker","lawyer","lecturer","legislator","librarian","lieutenant","lifeguard","lyricist","maestro","magician","magistrate","maid","major_leaguer","manager","marksman","marshal","mathematician","mechanic","mediator","medic","midfielder","minister","missionary","mobster","monk","musician","nanny","narrator","naturalist","negotiator","neurologist","neurosurgeon","novelist","nun","nurse","observer","officer","organist","painter","paralegal","parishioner","parliamentarian","pastor","pathologist","patrolman","pediatrician","performer","pharmacist","philanthropist","philosopher","photographer","photojournalist","physician","physicist","pianist","planner","plastic_surgeon","playwright","plumber","poet","policeman","politician","pollster","preacher","president","priest","principal","prisoner","professor","professor_emeritus","programmer","promoter","proprietor","prosecutor","protagonist","protege","protester","provost","psychiatrist","psychologist","publicist","pundit","rabbi","radiologist","ranger","realtor","receptionist","registered_nurse","researcher","restaurateur","sailor","saint","salesman","saxophonist","scholar","scientist","screenwriter","sculptor","secretary","senator","sergeant","servant","serviceman","sheriff_deputy","shopkeeper","singer","singer_songwriter","skipper","socialite","sociologist","soft_spoken","soldier","solicitor","solicitor_general","soloist","sportsman","sportswriter","statesman","steward","stockbroker","strategist","student","stylist","substitute","superintendent","surgeon","surveyor","swimmer","taxi_driver","teacher","technician","teenager","therapist","trader","treasurer","trooper","trucker","trumpeter","tutor","tycoon","undersecretary","understudy","valedictorian","vice_chancellor","violinist","vocalist","waiter","waitress","warden","warrior","welder","worker","wrestler","writer"]
import yaml
MODEL = "models/enwiki/ENWIKI"
import numpy as np
from sklearn.decomposition import PCA
from wikipedia2vec import Wikipedia2Vec
def defining_set_direction(defining_sets, n=0):
matrix = []
@ -22,7 +20,7 @@ def defining_set_direction(defining_sets, n=0):
#print("data matrix is: ")
#print(matrix)
pca.fit(matrix)
#print("Explained Variance Ratio: " + str(pca.explained_variance_ratio_))
print("Explained Variance Ratio: " + str(pca.explained_variance_ratio_))
return pca.components_[n]
def compute_bias_direction(model, pairs, n=0, ransac=False):
@ -40,7 +38,7 @@ def compute_bias_direction(model, pairs, n=0, ransac=False):
words.append((' '.join(w1),' '.join(w2)))
except KeyError as e:
print("Marzieh owes me a dragon")
print("Error on " + str((w1,w2)))
print("One of these words are missing: " + str((w1,w2)))
pass
g = defining_set_direction(defining_sets, n)
@ -80,14 +78,52 @@ def bias_by_word(model, neutral_words, defining_set, pca):
bias = np.dot(v,g)/(np.linalg.norm(v)*np.linalg.norm(g))
print(word + "," + str(bias))
else:
#print(word + ",NA")
print(word + ",NA")
pass
return 0
def main(yamlFilename):
### The following was used to create the initial yaml files.
##new_yaml = {'language':'English', 'language_code':'en', 'model':MODEL, 'neutral_words':NEUTRAL_WORDS, 'word_pairs':WORD_PAIRS}
##with open('english.yaml', 'wb') as yamlFile:
## yaml.dump(new_yaml, yamlFile, encoding='utf-16-le', allow_unicode=True)
##print(word_pairs_flat)
##print(new_yaml)
if __name__ == "__main__":
wiki2vec = Wikipedia2Vec.load(MODEL)
exit_code = 0
logging.info(f'Processing "{yamlFilename}"')
with open(yamlFilename, 'rb') as yamlFile:
#ASSUME that we are using a safe source for yaml.
data=yaml.load(yamlFile)
#DEBUG:
logging.debug(data)
bias_by_word(wiki2vec, NEUTRAL_WORDS1, WORD_PAIRS1, 0)
#bias_by_word(wiki2vec, NEUTRAL_WORDS2, WORD_PAIRS1, 0)
try:
logging.info(f'Language: "{data["language"]}"')
#complicated list comprehension, but basically iterates through data['word_pairs'] and returns a flat list of the list of lists.
data['word_pairs_flat'] = [item for pair in data['word_pairs'] for item in pair]
wiki2vec = Wikipedia2Vec.load(data['model'])
exit_code += bias_by_word(wiki2vec, data['neutral_words'], data['word_pairs'], 0)
exit_code += bias_by_word(wiki2vec, data['word_pairs_flat'],data['word_pairs'], 0)
#exit_code += bias_by_word(wiki2vec, data['neutral_words'], data['word_pairs'], 1)
#exit_code += bias_by_word(wiki2vec, data['word_pairs_flat'],data['word_pairs'], 1)
except KeyError as e:
logging.error(f'Unable to load key "{e.args[0]}" make sure it is in the yaml file!')
return exit_code
if __name__ == "__main__":
argParser = argparse.ArgumentParser()
argParser.add_argument('config', help='YAML file with data')
argParser.add_argument('--debug', action='store_true', help='Enables debug printing')
argParser.add_argument('--log', metavar='Log Filename', default=None, help='Logging Filename and enables logging.')
args = argParser.parse_args()
#defaults to INFO output, but can set debug to enable debugging output.
if args.debug:
logLevel = logging.DEBUG
else:
logLevel = logging.INFO
logging.basicConfig(filename=args.log,level=logLevel)
corpus_bias(wiki2vec, NEUTRAL_WORDS1, WORD_PAIRS1)
sys.exit(main(args.config))

BIN
chinese_old.yaml

93
old_files/bias.py

@ -0,0 +1,93 @@
import numpy as np
from sklearn.decomposition import PCA
import sys
from wikipedia2vec import Wikipedia2Vec
WORD_PAIRS1 = [["woman", "man"], ["daughter", "son"], ["mother", "father"], ["girl", "boy"], ["queen", "king"], ["wife", "husband"], ["madam", "sir"]]
WORD_PAIRS1_FLAT = ["woman", "man", "daughter", "son", "mother", "father", "girl", "boy", "queen", "king", "wife", "husband", "madam", "sir"]
NEUTRAL_WORDS1 = ['nurse', 'teacher', 'writer', 'engineer', 'scientist', 'manager', 'driver', 'banker', 'electrician', 'bartender', 'musician', 'artist', 'chef', 'filmmaker', 'judge', 'comedian', 'inventor', 'worker', 'soldier', 'journalist']
WORD_PAIRS2 = [["woman", "man"], ["daughter", "son"], ["mother", "father"], ["girl", "boy"], ["queen", "king"], ["wife", "husband"], ["madam", "sir"], ["she", "he"], ["her", "his"], ["mary", "john"], ["herself", "himself"], ["gal", "guy"], ["female", "male"]]
WORD_PAIRS2_FLAT = ["woman", "man", "daughter", "son", "mother", "father", "girl", "boy", "queen", "king", "wife", "husband", "madam", "sir", "she", "he", "her", "his", "mary", "john", "herself", "himself", "gal", "guy", "female", "male"]
NEUTRAL_WORDS2 = ["actor","accountant","acquaintance","actor","actress","adjunct_professor","administrator","adventurer","advocate","aide","alderman","alter_ego","ambassador","analyst","anthropologist","archaeologist","archbishop","architect","artist","artiste","assassin","assistant_professor","associate_dean","associate_professor","astronaut","astronomer","athlete","athletic_director","attorney","author","baker","ballerina","ballplayer","banker","barber","baron","barrister","bartender","biologist","bishop","bodyguard","bookkeeper","boss","boxer","broadcaster","broker","bureaucrat","businessman","businesswoman","butcher","butler","cab_driver","cabbie","cameraman","campaigner","captain","cardiologist","caretaker","carpenter","cartoonist","cellist","chancellor","chaplain","character","chef","chemist","choreographer","cinematographer","citizen","civil_servant","cleric","clerk","coach","collector","colonel","columnist","comedian","comic","commander","commentator","commissioner","composer","conductor","confesses","congressman","constable","consultant","cop","correspondent","councilman","councilor","counselor","critic","crooner","crusader","curator","custodian","dad","dancer","dean","dentist","deputy","dermatologist","detective","diplomat","director","disc_jockey","doctor","doctoral_student","drug_addict","drummer","economics_professor","economist","editor","educator","electrician","employee","entertainer","entrepreneur","environmentalist","envoy","epidemiologist","evangelist","farmer","fashion_designer","fighter_pilot","filmmaker","financier","firebrand","firefighter","fireman","fisherman","footballer","foreman","freelance_writer","gangster","gardener","geologist","goalkeeper","graphic_designer","guidance_counselor","guitarist","hairdresser","handyman","headmaster","historian","hitman","homemaker","hooker","housekeeper","house-wife","illustrator","industrialist","infielder","inspector","instructor","interior_designer","inventor","investigator","investment_banker","janitor","jeweler","journalist","judge","jurist","laborer","landlord","lawmaker","lawyer","lecturer","legislator","librarian","lieutenant","lifeguard","lyricist","maestro","magician","magistrate","maid","major_leaguer","manager","marksman","marshal","mathematician","mechanic","mediator","medic","midfielder","minister","missionary","mobster","monk","musician","nanny","narrator","naturalist","negotiator","neurologist","neurosurgeon","novelist","nun","nurse","observer","officer","organist","painter","paralegal","parishioner","parliamentarian","pastor","pathologist","patrolman","pediatrician","performer","pharmacist","philanthropist","philosopher","photographer","photojournalist","physician","physicist","pianist","planner","plastic_surgeon","playwright","plumber","poet","policeman","politician","pollster","preacher","president","priest","principal","prisoner","professor","professor_emeritus","programmer","promoter","proprietor","prosecutor","protagonist","protege","protester","provost","psychiatrist","psychologist","publicist","pundit","rabbi","radiologist","ranger","realtor","receptionist","registered_nurse","researcher","restaurateur","sailor","saint","salesman","saxophonist","scholar","scientist","screenwriter","sculptor","secretary","senator","sergeant","servant","serviceman","sheriff_deputy","shopkeeper","singer","singer_songwriter","skipper","socialite","sociologist","soft_spoken","soldier","solicitor","solicitor_general","soloist","sportsman","sportswriter","statesman","steward","stockbroker","strategist","student","stylist","substitute","superintendent","surgeon","surveyor","swimmer","taxi_driver","teacher","technician","teenager","therapist","trader","treasurer","trooper","trucker","trumpeter","tutor","tycoon","undersecretary","understudy","valedictorian","vice_chancellor","violinist","vocalist","waiter","waitress","warden","warrior","welder","worker","wrestler","writer"]
MODEL = "models/enwiki/ENWIKI"
def defining_set_direction(defining_sets, n=0):
matrix = []
for (w1,w2) in defining_sets:
center = (w1+w2)/2 #center for covariance to be nice
matrix.append(w1-center)
matrix.append(w2-center)
pca = PCA(n_components=10)
#print("data matrix is: ")
#print(matrix)
pca.fit(matrix)
#print("Explained Variance Ratio: " + str(pca.explained_variance_ratio_))
return pca.components_[n]
def compute_bias_direction(model, pairs, n=0, ransac=False):
defining_sets = []
words = []
for (w1,w2) in pairs:
try:
w1 = w1.lower().split()
w1vec = sum([model.get_word_vector(w) for w in w1])
w2 = w2.lower().split()
w2vec = sum([model.get_word_vector(w) for w in w2])
vector_pair = (w1vec,w2vec)
defining_sets.append(vector_pair)
words.append((' '.join(w1),' '.join(w2)))
except KeyError as e:
print("Marzieh owes me a dragon")
print("Error on " + str((w1,w2)))
pass
g = defining_set_direction(defining_sets, n)
return g
def corpus_bias(model, neutral_words, defining_set):
g = compute_bias_direction(model, defining_set)
print("Computing bias now")
# The sum of all word vectors
total = np.zeros(100);
count = 0.0
# The sum of dot products is the dot product of the sum
for word in neutral_words:
#if word in model:
if model.dictionary.get_word(word) is not None:
total += np.copy(model.get_word_vector(word))
count += 1.0
else:
#print("word " + word + " not in model")
pass
# We only need 1 dot product
total_bias = np.abs(np.dot(total,g)/(np.linalg.norm(total)*np.linalg.norm(g)))
print(total_bias)
def bias_by_word(model, neutral_words, defining_set, pca):
g = compute_bias_direction(model, defining_set, pca)
print("Computing bias now")
# This is much slower because its calculating len(neutral_words) dot products instead of 1
for word in neutral_words:
#if word in model:
if model.dictionary.get_word(word) is not None:
v = model.get_word_vector(word)
bias = np.dot(v,g)/(np.linalg.norm(v)*np.linalg.norm(g))
print(word + "," + str(bias))
else:
#print(word + ",NA")
pass
if __name__ == "__main__":
wiki2vec = Wikipedia2Vec.load(MODEL)
bias_by_word(wiki2vec, NEUTRAL_WORDS1, WORD_PAIRS1, 0)
#bias_by_word(wiki2vec, NEUTRAL_WORDS2, WORD_PAIRS1, 0)
corpus_bias(wiki2vec, NEUTRAL_WORDS1, WORD_PAIRS1)

0
bias_old.py → old_files/bias_old.py

88
old_files/en.py

@ -0,0 +1,88 @@
import numpy as np
from sklearn.decomposition import PCA
import sys
from wikipedia2vec import Wikipedia2Vec
WORD_PAIRS = [["woman", "man"], ["daughter", "son"], ["mother", "father"], ["girl", "boy"], ["queen", "king"], ["wife", "husband"], ["madam", "sir"]]
WORD_PAIRS_FLAT = ["woman", "man", "daughter", "son", "mother", "father", "girl", "boy", "queen", "king", "wife", "husband", "madam", "sir"]
NEUTRAL_WORDS = ['nurse', 'teacher', 'writer', 'engineer', 'scientist', 'manager', 'driver', 'banker', 'electrician', 'bartender', 'musician', 'artist', 'chef', 'filmmaker', 'judge', 'comedian', 'inventor', 'worker', 'soldier', 'journalist']
MODEL = "models/enwiki/ENWIKI"
def defining_set_direction(defining_sets, n=0):
matrix = []
for (w1,w2) in defining_sets:
center = (w1+w2)/2 #center for covariance to be nice
matrix.append(w1-center)
matrix.append(w2-center)
pca = PCA(n_components=10)
#print("data matrix is: ")
#print(matrix)
pca.fit(matrix)
#print("Explained Variance Ratio: " + str(pca.explained_variance_ratio_))
return pca.components_[n]
def compute_bias_direction(model, pairs, n=0, ransac=False):
defining_sets = []
words = []
for (w1,w2) in pairs:
try:
w1 = w1.lower().split()
w1vec = sum([model.get_word_vector(w) for w in w1])
w2 = w2.lower().split()
w2vec = sum([model.get_word_vector(w) for w in w2])
vector_pair = (w1vec,w2vec)
defining_sets.append(vector_pair)
words.append((' '.join(w1),' '.join(w2)))
except KeyError as e:
print("Marzieh owes me a dragon")
print("Error on " + str((w1,w2)))
pass
g = defining_set_direction(defining_sets, n)
return g
def corpus_bias(model, neutral_words, defining_set):
g = compute_bias_direction(model, defining_set)
print("Computing bias now")
# The sum of all word vectors
total = np.zeros(100);
count = 0.0
# The sum of dot products is the dot product of the sum
for word in neutral_words:
#if word in model:
if model.dictionary.get_word(word) is not None:
total += np.copy(model.get_word_vector(word))
count += 1.0
else:
#print("word " + word + " not in model")
pass
# We only need 1 dot product
total_bias = np.abs(np.dot(total,g)/(np.linalg.norm(total)*np.linalg.norm(g)))
print(total_bias)
def bias_by_word(model, neutral_words, defining_set, pca):
g = compute_bias_direction(model, defining_set, pca)
print("Computing bias now")
# This is much slower because its calculating len(neutral_words) dot products instead of 1
for word in neutral_words:
#if word in model:
if model.dictionary.get_word(word) is not None:
v = model.get_word_vector(word)
bias = np.dot(v,g)/(np.linalg.norm(v)*np.linalg.norm(g))
print(word + "," + str(bias))
else:
#print(word + ",NA")
pass
if __name__ == "__main__":
wiki2vec = Wikipedia2Vec.load(MODEL)
bias_by_word(wiki2vec, NEUTRAL_WORDS, WORD_PAIRS, 0)
bias_by_word(wiki2vec, WORD_PAIRS_FLAT, WORD_PAIRS, 0)

88
old_files/zh.py

@ -0,0 +1,88 @@
import numpy as np
from sklearn.decomposition import PCA
import sys
from wikipedia2vec import Wikipedia2Vec
WORD_PAIRS = [['女人', '男人'], ['女儿', '儿子'], ['母亲', '父亲'], ['女孩', '男孩'], ['皇后', '国王'], ['妻子', '丈夫'], ['女士', '先生']]
WORD_PAIRS_FLAT = ['女人', '男人', '女儿', '儿子', '母亲', '父亲', '女孩', '男孩', '皇后', '国王', '妻子', '丈夫', '女士', '先生']
NEUTRAL_WORDS = ['护士', '教师', '作家', '工程师', '科学家', '经理', '司机', '银行家', '电工', '酒保', '音乐家', '艺术家', '厨师', '制片人', '法官', '喜剧演员', '发明家', '工人', '战士', '记者']
MODEL = "models/zhwiki/ZHWIKI"
def defining_set_direction(defining_sets, n=0):
matrix = []
for (w1,w2) in defining_sets:
center = (w1+w2)/2 #center for covariance to be nice
matrix.append(w1-center)
matrix.append(w2-center)
pca = PCA(n_components=10)
#print("data matrix is: ")
#print(matrix)
pca.fit(matrix)
print("Explained Variance Ratio: " + str(pca.explained_variance_ratio_))
return pca.components_[n]
def compute_bias_direction(model, pairs, n=0, ransac=False):
defining_sets = []
words = []
for (w1,w2) in pairs:
try:
w1 = w1.lower().split()
w1vec = sum([model.get_word_vector(w) for w in w1])
w2 = w2.lower().split()
w2vec = sum([model.get_word_vector(w) for w in w2])
vector_pair = (w1vec,w2vec)
defining_sets.append(vector_pair)
words.append((' '.join(w1),' '.join(w2)))
except KeyError as e:
print("Marzieh owes me a dragon")
print("Error on " + str((w1,w2)))
pass
g = defining_set_direction(defining_sets, n)
return g
def corpus_bias(model, neutral_words, defining_set):
g = compute_bias_direction(model, defining_set)
print("Computing bias now")
# The sum of all word vectors
total = np.zeros(100);
count = 0.0
# The sum of dot products is the dot product of the sum
for word in neutral_words:
#if word in model:
if model.dictionary.get_word(word) is not None:
total += np.copy(model.get_word_vector(word))
count += 1.0
else:
#print("word " + word + " not in model")
pass
# We only need 1 dot product
total_bias = np.abs(np.dot(total,g)/(np.linalg.norm(total)*np.linalg.norm(g)))
print(total_bias)
def bias_by_word(model, neutral_words, defining_set, pca):
g = compute_bias_direction(model, defining_set, pca)
print("Computing bias now")
# This is much slower because its calculating len(neutral_words) dot products instead of 1
for word in neutral_words:
#if word in model:
if model.dictionary.get_word(word) is not None:
v = model.get_word_vector(word)
bias = np.dot(v,g)/(np.linalg.norm(v)*np.linalg.norm(g))
print(word + "," + str(bias))
else:
#print(word + ",NA")
pass
if __name__ == "__main__":
wiki2vec = Wikipedia2Vec.load(MODEL)
bias_by_word(wiki2vec, NEUTRAL_WORDS, WORD_PAIRS, 0)
bias_by_word(wiki2vec, WORD_PAIRS_FLAT, WORD_PAIRS, 0)

38
yamls/en.yaml

@ -0,0 +1,38 @@
language: English
model: models/enwiki/ENWIKI
neutral_words:
- nurse
- teacher
- writer
- engineer
- scientist
- manager
- driver
- banker
- electrician
- bartender
- musician
- artist
- chef
- filmmaker
- judge
- comedian
- inventor
- worker
- soldier
- journalist
word_pairs:
- - woman
- man
- - daughter
- son
- - mother
- father
- - girl
- boy
- - queen
- king
- - wife
- husband
- - madam
- sir

58
yamls/esf.yaml

@ -0,0 +1,58 @@
language: Spanish (female professions)
model: models/eswiki/ESWIKI
neutral_words:
# nurse
- enfermera
# teacher
- professora
# writer
- escritora
# engineer
- ingeniera
# scientist
- científica
# manager (neutral)
- gerente
# driver
- conductora
# banker
- banquera
# electrician (neutral)
- electricista
# bartender
- camarera
# musician
- música
# artist (neutral)
- artista
# chef
- cocinera
# filmmaker (neutral)
- cineasta
# judge
- jueza
# comedian
- cómica
# inventor
- inventora
# worker
- trabajadora
# soldier
- soldada
# journalist (neutral)
- periodista
word_pairs:
- - mujer
- hombre
- - hija
- hijo
- - madre
- padre
- - niña
- niño
- - reina
- rey
- - esposa
- esposo
- - señora
- señor

58
yamls/esm.yaml

@ -0,0 +1,58 @@
language: Spanish (male professions)
model: models/eswiki/ESWIKI
neutral_words:
# nurse
- enfermero
# teacher
- professor
# writer
- escritor
# engineer
- ingeniero
# scientist
- científica
# manager (neutral)
- gerente
# driver
- conductor
# banker
- banquero
# electrician (neutral)
- electricista
# bartender
- camarero
# musician
- músico
# artist (neutral)
- artista
# chef
- cocinero
# filmmaker (neutral)
- cineasta
# judge
- juez
# comedian
- cómico
# inventor
- inventor
# worker
- trabajador
# soldier
- soldado
# journalist (neutral)
- periodista
word_pairs:
- - mujer
- hombre
- - hija
- hijo
- - madre
- padre
- - niña
- niño
- - reina
- rey
- - esposa
- esposo
- - señora
- señor

58
yamls/fa.yaml

@ -0,0 +1,58 @@
language: Farsi
model: models/fawiki/FAWIKI
neutral_words:
# nurse
- پرستار
# teacher
- معلم
# writer
- نویسنده
# engineer
- مهندس
# scientist
- دانشمند
# manager
- مدیر
# driver
- راننده
# banker
- بانکدار
# electrician
- برقکار
# bartender (might need update)
- میخانه دار
# musician
- موسیقیدان
# artist
- هنرمند
# chef
- آشپز
# filmmaker
- فیبمساز
# judge
- فاضی
# comedian
- کمدین
# inventor
- مخترع
# worker
- کارگر
# soldier
- سرباز
# journalist
- روزنامه نگار
word_pairs:
- - زن
- مرد
- - دختر
- پسر
- - مادر
- پدر
- - دختر
- پسر
- - ملکہ
- پادشاه
- - همسر
- شوهر
- - خانم
- آقا

41
yamls/frf.yaml

@ -0,0 +1,41 @@
language: French
model: models/frwiki/FRWIKI
neutral_words:
- infirmière
- professeuse
- écrivaine
- ingénieuse
# Neutral
- scientifique
- directrice
- chauffeuse
- banquière
- électricienne
- barmaid
- musicienne
# Neutral
- artiste
- chef
- cinéaste
# Neutral
- juge
- comédienne
- inventrice
- ouvrière
- soldat
- journaliste
word_pairs:
- - femme
- homme
- - fille
- fils
- - mère
- père
- - fille
- garçon
- - reine
- roi
- - épouse
- mari
- - madame
- monsieur

43
yamls/frm.yaml

@ -0,0 +1,43 @@
language: French
model: models/frwiki/FRWIKI
neutral_words:
- infirmièr
- professeur
- écrivain
- ingénieur
# Neutral
- scientifique
- directeur
- chauffeus
- banquièr
- électricien
- barman
- musicien
# Neutral
- artiste
# Neutral
- chef
# Neutral
- cinéaste
# Neutral
- juge
- comédien
- inventeur
- ouvrièr
- soldat
- journaliste
word_pairs:
- - femme
- homme
- - fille
- fils
- - mère
- père
- - fille
- garçon
- - reine
- roi
- - épouse
- mari
- - madame
- monsieur

BIN
yamls/zh.yaml

Loading…
Cancel
Save