Ktrain
ktrain is a Python library that makes deep learning and AI more accessible and easier to apply
Install / Use
/learn @amaiya/KtrainREADME
Overview | Tutorials | Examples | Installation | FAQ | API Docs | How to Cite
<!--[](https://twitter.com/ktrain_ai)--> <p align="center"> <img src="https://github.com/amaiya/ktrain/raw/master/ktrain_logo_200x100.png" width="200"/> </p>Welcome to ktrain
a "Swiss Army knife" for machine learning
News and Announcements
- 2024-02-20
- ktrain 0.41.x is released and removes the
ktrain.text.qa.generative_qamodule. Our OnPrem.LLM package should be used for Generative Question-Answering tasks. See example notebook.
- ktrain 0.41.x is released and removes the
Overview
ktrain is a lightweight wrapper for the deep learning library TensorFlow Keras (and other libraries) to help build, train, and deploy neural networks and other machine learning models. Inspired by ML framework extensions like fastai and ludwig, ktrain is designed to make deep learning and AI more accessible and easier to apply for both newcomers and experienced practitioners. With only a few lines of code, ktrain allows you to easily and quickly:
-
employ fast, accurate, and easy-to-use pre-canned models for
text,vision,graph, andtabulardata:textdata:- Text Classification: BERT, DistilBERT, NBSVM, fastText, and other models <sub><sup>[example notebook]</sup></sub>
- Text Regression: BERT, DistilBERT, Embedding-based linear text regression, fastText, and other models <sub><sup>[example notebook]</sup></sub>
- Sequence Labeling (NER): Bidirectional LSTM with optional CRF layer and various embedding schemes such as pretrained BERT and fasttext word embeddings and character embeddings <sub><sup>[example notebook]</sup></sub>
- Ready-to-Use NER models for English, Chinese, and Russian with no training required <sub><sup>[example notebook]</sup></sub>
- Sentence Pair Classification for tasks like paraphrase detection <sub><sup>[example notebook]</sup></sub>
- Unsupervised Topic Modeling with LDA <sub><sup>[example notebook]</sup></sub>
- Document Similarity with One-Class Learning: given some documents of interest, find and score new documents that are thematically similar to them using One-Class Text Classification <sub><sup>[example notebook]</sup></sub>
- Document Recommendation Engines and Semantic Searches: given a text snippet from a sample document, recommend documents that are semantically-related from a larger corpus <sub><sup>[example notebook]</sup></sub>
- Text Summarization: summarize long documents - no training required <sub><sup>[example notebook]</sup></sub>
- Extractive Question-Answering: ask a large text corpus questions and receive exact answers using BERT <sub><sup>[example notebook]</sup></sub>
- Generative Question-Answering: ask a large text corpus questions and receive answers with citations using local or OpenAI models <sub><sup>[example notebook]</sup></sub>
- Easy-to-Use Built-In Search Engine: perform keyword searches on large collections of documents <sub><sup>[example notebook]</sup></sub>
- Zero-Shot Learning: classify documents into user-provided topics without training examples <sub><sup>[example notebook]</sup></sub>
- Language Translation: translate text from one language to another <sub><sup>[example notebook]</sup></sub>
- Text Extraction: Extract text from PDFs, Word documents, etc. <sub><sup>[example notebook]</sup></sub>
- Speech Transcription: Extract text from audio files <sub><sup>[example notebook]</sup></sub>
- Universal Information Extraction: extract any kind of information from documents by simply phrasing it in the form of a question <sub><sup>[example notebook]</sup></sub>
- Keyphrase Extraction: extract keywords from documents <sub><sup>[example notebook]</sup></sub>
- Sentiment Analysis: easy-to-use wrapper to pretrained sentiment analysis <sub><sup>[example notebook]</sup>
- Generative AI with GPT: Provide instructions to a lightweight ChatGPT-like model running on your own own machine to solve various tasks. <sub><sup>[example notebook]</sup>
visiondata:- image classification (e.g., ResNet, Wide ResNet, Inception) <sub><sup>[example notebook]</sup></sub>
- image regression for predicting numerical targets from photos (e.g., age prediction) <sub><sup>[example notebook]</sup></sub>
- image captioning with a pretrained model <sub><sup>[example notebook]</sup></sub>
- object detection with a pretrained model <sub><sup>[example notebook]</sup></sub>
graphdata:- node classification with graph neural networks (GraphSAGE) <sub><sup>[example notebook]</sup></sub>
- link prediction with graph neural networks (GraphSAGE) <sub><sup>[example notebook]</sup></sub>
tabulardata:- tabular classification (e.g., Titanic survival prediction) <sub><sup>[example notebook]</sup></sub>
- tabular regression (e.g., predicting house prices) <sub><sup>[example notebook]</sup></sub>
- causal inference using meta-learners <sub><sup>[example notebook]</sup></sub>
-
estimate an optimal learning rate for your model given your data using a Learnin
