Giter Site home page Giter Site logo

flexible-fl / flex-nlp Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 108 KB

Natural Language Processing (NLP) using the FLEXible framework.

License: GNU Affero General Public License v3.0

Python 22.16% Jupyter Notebook 77.84%
dataset federated-learning flexible-framework models nlp

flex-nlp's Introduction

flex-nlp

The flex-nlp package consists of a set of tools and utilities to work with Natural Language Processing (NLP) datasets and models. It is designed to be used with the FLEXible framework, as it is an extension of it.

flex-nlp comes with some tools to work with NLP datasets, that are the following ones:

  • ss_triplet_input_adapter a Semantic Textual Similarity (STS) dataset adapter: It is a dataset adapter that allows to work with the TripletQQP dataset and other datasets that are similar to it.
  • default_data_collator_classification: It is a data collator that allows to work with the classification task, and it is the default data collator for the classification task.
  • basic_collate_pad_sequence_classification: It is a data collator that allows to work with the classification task, and it is a basic data collator for the classification task. This collator pads the sequences to the maximum length of the batch, and it puts the batch dimension in the first position.

We also provide an aggregator to work with neural networks, clip_avg. Alonside, we have used some aggregator available in the FLEXible framework.

Aggregator Description Citation
clip_avg It is a federated aggregator that clips the weights recieved by the clients, averaging only those that surpass a selected threshold. Reviewing Federated Learning Aggregation Algorithms; Strategies, Contributions, Limitations and Future Perspectives
fedavg It is a federated aggregator that compute the mean of the weights recieved by the clients. Communication-Efficient Learning of Deep Networks from Decentralized Data
weighted_avg Similar to fedavg, it is a federated aggregator that add weights to the clients in order of giving more importance to some clients than to another clients. Communication-Efficient Learning of Deep Networks from Decentralized Data

 Tutorials

To get started with flex-nlp, you can check the notebooks available in the repository. They cover the following topics:

In the following we detail the tasks, models, and the datasets used in the notebooks:

Task Model Dataset
Sentiment Analysis (SA) BiGRU IMDb
Question Answering (QA) DistilBERT SQuAD
Semantic Textual Similarity (STS) DistilRoberta QQP-Triplets

Installation

We recommend Anaconda/Miniconda as the package manager. The following is the corresponding flex-nlp versions and supported Python versions.

flex flex-nlp Python
main / nightly main / nightly >=3.8, <=3.11
v0.6.0 v0.1.0 >=3.8, <=3.11

To install the package, you can use the following commands:

Using pip:

pip install flexnlp

Download the repository and install it locally:

git clone [email protected]:FLEXible-FL/flex-nlp.git
cd flex-nlp
pip install -e .

## Citation

If you use this package, please cite the following paper:

TODO: Add citation

flex-nlp's People

Contributors

alargente avatar cristinazuhe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.