Package: adaptnlp
Welcome to AdaptNLPA high level framework and library for running, training, and deploying state-of-the-art Natural Language Processing (NLP) models for end to end tasks.What is AdaptNLP?AdaptNLP is a python package that allows users ranging from beginner python coders to experienced Machine Learning Engineers to leverage
state-of-the-art Natural Language Processing (NLP) models and training techniques in one easy-to-use python package.Utilizingfastaiwith HuggingFace'sTransformerslibrary and Humboldt University of Berlin'sFlairlibrary, AdaptNLP provides Machine Learning Researchers and Scientists a modular andadaptiveapproach to a variety of NLP tasks simplifying what it takes totrain, performinference, anddeployNLP-based models and microservices.What is the Benefit of AdaptNLP Rather Than Just Using Transformers?Despite quick inference functionalities such as thepipelineAPI intransformers, it still is not quite as flexible nor fast enough. With AdaptNLP'sEasy*inference modules, these tend to be slightly faster than thepipelineinterface (bare minimum the same speed), while also providing the user with simple intuitive returns to alleviate any unneeded junk that may be returned.Along with this, with the integration of thefastailibrary the code needed to train or run inference on your models has a completely modular API through thefastaiCallbacksystem. Rather than needing to write your entire torch loop, if there is anything special needed for a model a Callback can be written in less than 10 lines of code to achieve your specific functionalities.Finally, when training your model fastai is on the forefront of beign a library constantly bringing in the best practices for achiving state-of-the-art training with new research methodologies heavily tested before integration. As such, AdaptNLP fully supports training with the One-Cycle policy, and using new optimizer combinations such as the Ranger optimizer with Cosine Annealing training through simple one-line fitting functions (fit_one_cycleandfit_flat_cos).Installation DirectionsPyPiTo install with pypi, please use:pipinstalladaptnlpOr if you have pip3:pip3installadaptnlpConda (Coming Soon)Developmental BuildsTo install any developmental style builds, please follow the below directions to install directly from git:Stable Master BranchThe master branch generally is not updated much except for hotfixes and new releases. To install please use:pipinstallgit+https://github.com/Novetta/adaptnlpDevelopmental Branch{% include note.html content='Generally this branch can become unstable, and it is only recommended for contributors or those that really want to test out new technology. Please make sure to see if the latest tests are passing (A green checkmark on the commit message) before trying this branch out' %}
You can install the developmental builds with:pipinstallgit+https://github.com/Novetta/adaptnlp@devDocker ImagesThere are actively updated Docker images hosted on Novetta'sDockerHubThe guide to each tag is as follows:latest: This is the latest pypi release and installs a complete package that is CUDA capabledev: These are occasionally built developmental builds at certain stages. They are built by thedevbranch and are generally stable*api: The API builds are for theREST-APITo pull and run any AdaptNLP image immediatly you can run:dockerrun-itp8888:8888novetta/adaptnlp:TAGReplacingTAGwith any of the afformentioned tags earlier.Afterwards checklocalhost:8888orlocalhost:888/labto access the notebook containersNavigating the DocumentationThe AdaptNLP library is built withnbdev, so any documentation page you find (including this one!) can be directly run as a Jupyter Notebook. Each page at the top includes an "Open in Colab" button as well that will open the notebook in Google Colaboratory to allow for immediate access to the code.The documentation is split into six sections, each with a specific purpose:Getting StartedThis group contains quick access to the homepage, what are the AdaptNLP Cookbooks, and how to contributeModels and Model HubsThese contain any relevant documentation for theAdaptiveModelclass, the HuggingFace Hub model search integration, and theResultclass that various inference API's returnClass APIThis section contains the module documentation for the inference framework, the tuning framework, as well as the utilities and foundations for the AdaptNLP library.Inference and Training CookbooksThese two sections providequickaccess tosingle userecipies for starting any AdaptNLP project for a particular task, with easy to use code designed for that specific use case.
There are currently over 13 different tutorials available, with more coming soon.NLP Services with FastAPIThis section provides directions on how to use the AdaptNLP REST API for deploying your models quickly with FastAPIContributingThere is a controbution guide availablehereTestingAdaptNLP is run on thenbdevframework. To run all tests please do the following:pip install nbverbosegit clone https://github.com/Novetta/adaptnlpcd adaptnlppip install -e .nbdev_test_nbsThis will run every notebook and ensure that all tests have passed. Please see the nbdevdocumentationfor more information about it.ContactPlease contact Zachary Mueller atzmueller@novetta.comwith questions or comments regarding AdaptNLP.Follow  us on Twitter at@TheZachMuellerand@AdaptNLPfor
updates and NLP dialogue.LicenseThis project is licensed under the terms of the Apache 2.0 license.