Federated Natural Language Processing Module References

federatedscope.nlp.dataset

federatedscope.nlp.dataloader

federatedscope.nlp.dataloader.load_nlp_dataset(config=None)[source]

Return the dataset of shakespeare, subreddit, twitter, or synthetic.

Parameters

config – configurations for FL, see federatedscope.core.configs

Returns

FL dataset dict, with client_id as key.

Note

load_nlp_dataset() will return a dict as shown below:

` {'client_id': {'train': dataset, 'test': dataset, 'val': dataset}} `

federatedscope.nlp.model

class federatedscope.nlp.model.LSTM(in_channels, hidden, out_channels, n_layers=2, embed_size=8, dropout=0.0)[source]
forward(input_)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

federatedscope.nlp.trainer