FMAT_query {FMAT} | R Documentation |
Prepare a data.table of queries and variables for the FMAT.
FMAT_query(
query = "Text with [MASK], optionally with {TARGET} and/or {ATTRIB}.",
MASK = .(),
TARGET = .(),
ATTRIB = .()
)
query |
Query text (should be a character string/vector
with at least one |
MASK |
A named list of For model vocabulary, see, e.g., https://huggingface.co/bert-base-uncased/raw/main/vocab.txt Infrequent words may be not included in a model's vocabulary,
and in this case you may insert the words into the context by
specifying either |
TARGET , ATTRIB |
A named list of Target/Attribute words or phrases.
If specified, then |
A data.table of queries and variables.
FMAT_query("[MASK] is a nurse.", MASK = .(Male="He", Female="She"))
FMAT_query(
c("[MASK] is {TARGET}.", "[MASK] works as {TARGET}."),
MASK = .(Male="He", Female="She"),
TARGET = .(Occupation=cc("a doctor, a nurse, an artist"))
)
FMAT_query(
"The [MASK] {ATTRIB}.",
MASK = .(Male=cc("man, boy"),
Female=cc("woman, girl")),
ATTRIB = .(Masc=cc("is masculine, has a masculine personality"),
Femi=cc("is feminine, has a feminine personality"))
)
FMAT_query(
"The association between {TARGET} and {ATTRIB} is [MASK].",
MASK = .(H="strong", L="weak"),
TARGET = .(Flower=cc("rose, iris, lily"),
Insect=cc("ant, cockroach, spider")),
ATTRIB = .(Pos=cc("health, happiness, love, peace"),
Neg=cc("death, sickness, hatred, disaster"))
)