Package: zensols.deepnlp
DeepZensols Natural Language ProcessingDeep learning utility library for natural language processing that aids in
feature engineering and embedding layers.See thefull documentation.See thepaperFeatures:Configurable layers with little to no need to write code.Natural language specific layers:Easily configurable word embedding layers forGlove,Word2Vec,fastText.Huggingface transformer (BERT) context based word vector layer.FullEmbedding+BiLSTM-CRFimplementation using easy to configure
constituent layers.NLP specific vectorizersthat generatezensols deeplearnencoded and
decodedbatched tensorsforspaCyparsed features, dependency tree
features, overlapping text features and others.Easily swapable during runtime embedded layers asbatched tensorsand other
linguistic vectorized features.Support for token, document and embedding level vectorized features.Transformer word piece to linguistic token mapping.Two full documented reference models provided as both command line andJupyter notebooks.Command line support for training, testing, debugging, and creating
predictions.DocumentationFull documentationLayers: NLP specific
layers such as embeddings and transformersVectorizers:
specific vectorizers that digitize natural language text in to tensors ready
asPyTorchinputAPI referenceReference ModelsObtainingThe easiest way to install the command line program is via thepipinstaller:pip3installzensols.deepnlpBinaries are also available onpypi.UsageThe API can be used as is and manually configuring each component.  However,
this (like any Zensols API) was designed to instantiated with inverse of
control usingresource libraries.ComponentComponents and out of the box models are available with little to no coding.
However, thissimple examplethat uses the
library's components is recommended for starters.  The example is a command
line application that in-lines a simple configuration needed to create deep
learning NLP components.Similarly,this exampleis also a command line
example, but uses a masked langauge model to fill in words.Reference ModelsIf you're in a rush, you can dive right in to theClickbate Text
Classificationreference model, which is a working project that uses this
library.  However, you'll either end up reading up on thezensols deeplearnlibrary before or during the tutorial.The usage of this library is explained in terms of the reference models:TheClickbate Text Classificationis the best reference model to start with
because the only code consists of is the corpus reader and a module to remove
sentence segmentation (corpus are newline delimited headlines).  It was also
usesresource libraries, which greatly reduces complexity, where as the
other reference models do not.  Also see theJupyter clickbate
classification notebook.TheMovie Review Sentimenttrained and tested on theStanford movie
reviewandCornell sentiment polaritydata sets, which assigns a positive
or negative score to a natural language movie review by critics.  Also see
theJupyter movie sentiment notebook.TheNamed Entity Recognizertrained and tested on theCoNLL 2003 data setto label named entities on natural language text.  Also see theJupyter NER
notebook.The unit test cases are also a good resource for the more detailed programming
integration with various parts of the library.AttributionThis project, or reference model code, uses:GensimforGlove,Word2VecandfastTextword embeddings.Huggingface TransformersforBERTcontextual word embeddings.h5pyfor fast read access to word embedding vectors.zensols nlparsefor feature generation fromspaCyparsing.zensols deeplearnfor deep learning network libraries.Corpora used include:Stanford movie reviewCornell sentiment polarityCoNLL 2003 data setCitationIf you use this project in your research please use the following BibTeX entry:@inproceedings{landes-etal-2023-deepzensols,title="{D}eep{Z}ensols: A Deep Learning Natural Language Processing Framework for Experimentation and Reproducibility",author="Landes, Paul  andDi Eugenio, Barbara  andCaragea, Cornelia",editor="Tan, Liling  andMilajevs, Dmitrijs  andChauhan, Geeticka  andGwinnup, Jeremy  andRippeth, Elijah",booktitle="Proceedings of the 3rd Workshop for Natural Language Processing Open Source Software (NLP-OSS 2023)",month=dec,year="2023",address="Singapore, Singapore",publisher="Empirical Methods in Natural Language Processing",url="https://aclanthology.org/2023.nlposs-1.16",pages="141--146"}ChangelogAn extensive changelog is availablehere.CommunityPlease star this repository and let me know how and where you use this API.
Contributions as pull requests, feedback and any input is welcome.LicenseMIT LicenseCopyright (c) 2020 - 2023 Paul Landes