TensorAgent: TensorAgent: a model of bilingual lexical selection.

Description Usage Format Value Fields Methods Examples

Description

This class implements the model of individual lexical selection described in Ellison & Miceli (2017 - Language 93(2):255-287) - hereafter EM. It is implemented using the TensorA, because that class facilitates linear calculations parameterised over a variable number of parameter dimensions.

Usage

1

Format

R6Class object.

Value

Object of class TensorAgent.

Fields

Documentation

Here are TensorModel's fields. EM abbreviates Ellison & Miceli (2017).

$LanguageMode

This is the language mode parameter on a scale [0,1].

$MonitoringLevel

The is the effort put into monitoring on a scale [0,1].

$Meanings

The meanings currently in the lexicon (a list of strings).

$Languages

The languages modelled in the lexicon (a list of strings).

$NumberOfLanguages

The number of languages modelled in the lexicon (integer).

$LexicalTensor

The tensor with the frequency of occurrence for each language-meaning-form combination.

$version

An integer tracking whether updates to values to avoid repeated calculation of the same values.

$delta_lt

Kronecker delta (1 if l=t zero otherwise), see Equation 2 in EM.

$p_l_t__b

Probability of using language l given a target language t and language mode b.

$p_f_sl

Probability of using form f to represent meaning s in language l, see Equation 3 in EM.

$p_f_st__b

Probability of using form f to representing meaning s when trying to use language t and the bilingual mode is b, see Equation 4 in EM.

$p_l_fst__bm

Probability of identifying language l as the source of form f when trying to express meaning s in language t, see Equation 8 in EM.

$p_f_st__bm

Probability of using form f to express meaning s when aiming to speak language t, given bilingual mode b and monitoring level m, see Equation 11 in EM.

$p_l_t__b_version

The version number associated with the current value of p_l_t__b.

$p_f_sl_version

The version number associated with the current value of p_f_sl.

$p_f_st__b_version

The version number associated with the current value of p_st__b.

$p_l_fst__bm_version

The version number associated with the current value of p_l_fst__bm.

$p_f_st__bm_version

The version number associated with the current value of p_f_st__bm.

Methods

$new()

Creates a new, empty TensorModel object.

$clearLexicon()

Empties the lexical memory, removing all meaning-language-form triples.

$setLanguageMode(languageMode)

Set the level of interaction between target and other languages.

$setMonitoringLevel(monitoringLevel)

Set the level of monitoring exerted by the agent.

$addExample(meaning,language,form,ct=1)

Adds meaning-language-form triple to the model if it does not exist already. It then adds ct to the frequency recorded for this triple.

$normalise(t,overIndices)

Normalise a tensor t over some vector of indices overIndices.

$constructDataTensor()

Uses the tuples entered using $addExample(..) to build a tensor representing the distribution over experienced meaning-language-form combinations.

$makeMeLanguagePairs()

Constructs a rank-2 tensor, both of whose indices range over languages, and whose values for each dimension combination is 1.0.

$make_p_l_t__b()

Calculate the probability of a language given a target language.

$make_p_f_sl()

Calculate the probability of using form f to represent meaning s in language l.

$make_p_f_st__b()

Calculate the probability of using form f to representing meaning s when trying to use language t and the bilingual mode is b.

$make_p_l_fst__bm()

Calculate the probability of identifying language l as the source of form f when trying to express meaning s in language t.

$make_p_f_st__bm()

Calculate the probability of using form f to express meaning s when aiming to speak language t, given bilingual mode b and monitoring level m.

$as.data.frame()

Create a data frame with columns Meaning, Language, Form and probability of form p, giving the distribution p_f_st__bm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(bldR)
ta <- TensorAgent$new();
ta$clearLexicon();
ta$addExample("PHOTO","English","foto",    ct=0.5);
ta$addExample("PHOTO","English","picture", ct=0.5);
ta$addExample("PHOTO","Dutch",  "foto",    ct=1.0);
ta$constructDataTensor();
ta$setLanguageMode(0.4);
ta$setMonitoringLevel(0.8);
ta$make_p_f_st__bm();
df <- ta$as.data.frame();
print(df);

tyrannomark/bldR documentation built on May 5, 2019, 9:03 p.m.