Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

spaCy extension for kenLM.

Project description

## spacy_kenlm: KenLM extension for spaCy 2.0

This package adds [kenLM]( support
as a [spaCy 2.0 extension](

## Usage

Train a `kenLM` language model first (or use the test model from ``).

Add the spaCyKenLM to the spaCy pipeline to return scores.

import spacy
from spacy_kenlm import spaCyKenLM

nlp = spacy.load('en_core_web_sm')

spacy_kenlm = spaCyKenLM() # default model from


doc = nlp('How are you?')

# doc score

# span score

# token score

## Installation

Install from the pip package.

pip install spacy_kenlm

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for spacy_kenlm, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size spacy_kenlm-0.1.1.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page