query | R Documentation |
This function makes a query based on the supplied parameters. The object can then be displayed by the S3 method print.sweater()
and plotted by plot.sweater()
.
query(
w,
S_words,
T_words,
A_words,
B_words,
method = "guess",
verbose = FALSE,
...
)
## S3 method for class 'sweater'
print(x, ...)
w |
a numeric matrix of word embeddings, e.g. from |
S_words |
a character vector of the first set of target words. In an example of studying gender stereotype, it can include occupations such as programmer, engineer, scientists... |
T_words |
a character vector of the second set of target words. In an example of studying gender stereotype, it can include occupations such as nurse, teacher, librarian... |
A_words |
a character vector of the first set of attribute words. In an example of studying gender stereotype, it can include words such as man, male, he, his. |
B_words |
a character vector of the second set of attribute words. In an example of studying gender stereotype, it can include words such as woman, female, she, her. |
method |
string, the method to be used to make the query. Available options are:
|
verbose |
logical, whether to display information |
... |
additional parameters for the underlying function
|
x |
a sweater S3 object |
a sweater S3 object
weat()
, mac()
, nas()
, semaxis()
, rnsb()
, rnd()
, nas()
, ect()
data(googlenews)
S1 <- c("janitor", "statistician", "midwife", "bailiff", "auctioneer",
"photographer", "geologist", "shoemaker", "athlete", "cashier", "dancer",
"housekeeper", "accountant", "physicist", "gardener", "dentist", "weaver",
"blacksmith", "psychologist", "supervisor", "mathematician", "surveyor",
"tailor", "designer", "economist", "mechanic", "laborer", "postmaster",
"broker", "chemist", "librarian", "attendant", "clerical", "musician",
"porter", "scientist", "carpenter", "sailor", "instructor", "sheriff",
"pilot", "inspector", "mason", "baker", "administrator", "architect",
"collector", "operator", "surgeon", "driver", "painter", "conductor",
"nurse", "cook", "engineer", "retired", "sales", "lawyer", "clergy",
"physician", "farmer", "clerk", "manager", "guard", "artist", "smith",
"official", "police", "doctor", "professor", "student", "judge",
"teacher", "author", "secretary", "soldier")
A1 <- c("he", "son", "his", "him", "father", "man", "boy", "himself",
"male", "brother", "sons", "fathers", "men", "boys", "males", "brothers",
"uncle", "uncles", "nephew", "nephews")
B1 <- c("she", "daughter", "hers", "her", "mother", "woman", "girl",
"herself", "female", "sister", "daughters", "mothers", "women", "girls",
"females", "sisters", "aunt", "aunts", "niece", "nieces")
garg_f1 <- query(googlenews, S_words = S1, A_words = A1, B_words = B1)
garg_f1
plot(garg_f1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.