All Projects → desilinguist → swig-srilm

desilinguist / swig-srilm

Licence: other
SWIG Wrapper for the SRILM toolkit

Programming Languages

c
50402 projects - #5 most used programming language
perl
6916 projects
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to swig-srilm

Libsodium Jni
(Android) Networking and Cryptography Library (NaCL) JNI binding. JNI is utilized for fastest access to native code. Accessible either in Android or Java application. Uses SWIG to generate Java JNI bindings. SWIG definitions are extensible to other languages.
Stars: ✭ 157 (+375.76%)
Mutual labels:  swig
COCO-LM
[NeurIPS 2021] COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining
Stars: ✭ 109 (+230.3%)
Mutual labels:  language-model
calm
Context Aware Language Models
Stars: ✭ 29 (-12.12%)
Mutual labels:  language-model
Cppsharp
Tools and libraries to glue C/C++ APIs to high-level languages
Stars: ✭ 2,221 (+6630.3%)
Mutual labels:  swig
PLBART
Official code of our work, Unified Pre-training for Program Understanding and Generation [NAACL 2021].
Stars: ✭ 151 (+357.58%)
Mutual labels:  language-model
rnn-theano
RNN(LSTM, GRU) in Theano with mini-batch training; character-level language models in Theano
Stars: ✭ 68 (+106.06%)
Mutual labels:  language-model
Generator Hexo Theme
Generate a hexo theme: ejs, pug, swig, nunjucks | Moved to https://tcrowe.commons.host/contact
Stars: ✭ 119 (+260.61%)
Mutual labels:  swig
gap-text2sql
GAP-text2SQL: Learning Contextual Representations for Semantic Parsing with Generation-Augmented Pre-Training
Stars: ✭ 83 (+151.52%)
Mutual labels:  language-model
TF-NNLM-TK
A toolkit for neural language modeling using Tensorflow including basic models like RNNs and LSTMs as well as more advanced models.
Stars: ✭ 20 (-39.39%)
Mutual labels:  language-model
asr24
24-hour Automatic Speech Recognition
Stars: ✭ 27 (-18.18%)
Mutual labels:  language-model
Quantlib Swig
QuantLib wrappers to other languages
Stars: ✭ 176 (+433.33%)
Mutual labels:  swig
Gdcm
Grassroots DICOM read-only mirror. Only for Pull Request. Please report bug at http://sf.net/p/gdcm
Stars: ✭ 240 (+627.27%)
Mutual labels:  swig
Vaaku2Vec
Language Modeling and Text Classification in Malayalam Language using ULMFiT
Stars: ✭ 68 (+106.06%)
Mutual labels:  language-model
Pymupdf Debian
Packaging of pymupdf for Debian
Stars: ✭ 171 (+418.18%)
Mutual labels:  swig
CharLM
Character-aware Neural Language Model implemented by PyTorch
Stars: ✭ 32 (-3.03%)
Mutual labels:  language-model
Cpachecker
CPAchecker, the Configurable Software-Verification Platform (read-only mirror)
Stars: ✭ 138 (+318.18%)
Mutual labels:  swig
pd3f
🏭 PDF text extraction pipeline: self-hosted, local-first, Docker-based
Stars: ✭ 132 (+300%)
Mutual labels:  language-model
lm-scorer
📃Language Model based sentences scoring library
Stars: ✭ 264 (+700%)
Mutual labels:  language-model
personality-prediction
Experiments for automated personality detection using Language Models and psycholinguistic features on various famous personality datasets including the Essays dataset (Big-Five)
Stars: ✭ 109 (+230.3%)
Mutual labels:  language-model
KB-ALBERT
KB국민은행에서 제공하는 경제/금융 도메인에 특화된 한국어 ALBERT 모델
Stars: ✭ 215 (+551.52%)
Mutual labels:  language-model

Bitdeli Badge

SWIG-SRILM: A SWIG-based wrapper for an SRILM language model

==========

Description

This package contains files to generate Perl and Python wrappers for SRILM language models.

Requirements

  • GNU make
  • Simplified Wrapper & Interface Generator (SWIG)
  • A local Python and/or Perl installation
  • The SRILM toolkit (v1.7.1). If you have an older version of SRILM e.g., the 1.5.x series then you should use the old_srilm branch. Note that SRILM should have been compiled as position independent code. You can do that by using the command MAKE_PIC=yes make when compiling SRILM.

Installation:

Linux

  • Modify the following environment variables at the top of the included Makefile:

  • SRILM_LIBS : The directory containing the SRILM libraries

  • SRILM_INC : The directory containing the SRILM header files

  • PYTHON_INC : The directory containing the python header files

  • PERL_INC : The directory containing the perl header files

  • To create a Python module, run 'make python' in this directory. Copy _srilm.so and srilm.py to your directory where you want to use the python module. You can run the included test.py script to check whether the compiled module works correctly. The output of test.py should be the following:

1. Number of n-grams:
   There are 11868 unigrams in this LM
   There are 59481 bigrams in this LM
   There are 16744 trigrams in this LM
   There are 13787 4-grams in this LM
   There are 12082 5-grams in this LM

2. N-gram log probabilities:
   p('good') = -3.49373698235
   p('of the') = -0.558740794659
   p('nitin madnani') = -99.0
   p('there are some') = -0.985605716705
   p('do more about your') = -0.469523012638
   p('or whatever has yet to') = -0.53226429224

3. Sentence log probabilities and perplexities:
   p('there are some good') = -9.85836982727
   ppl('there are some good') = 93.6858444214

4. OOvs:
   nOOVs('there are some foobar') = 1

5. Corpus log probabilties and perplexities:
   Logprob for the file test.txt = -33.6016654968
   Perplexity for the file test.txt = 94.7476806641
  • To create a Perl module, run make perl in this directory. Copy srilm.so and srilm.pm to the directory of your choice. Run the included Perl script 'test.pl' to test whether the compiled module works correctly. The output should be the same as above.

Mac OS X

Note: This has only been tested on OS X El Capitan and only with the built-in versions of python (2.7.10) and perl (5.18).

  • Check out the macosx branch.

  • Make sure you have compiled the SRILM libraries (MAKE_PIC=yes make).

  • Go to the directory containing the SRILM header files ($SRILM/include), open File.h and comment out the line that says #include "zio.h". This is necessary because even though SRILM is supposed to rename the zopen() function to my_zopen() on OS X since zlib is installed by default, it does not seem to work. So, this is a hacky workaround.

  • Modify the following environment variables at the top of Makefile.osx:

  • SRILM_LIBS : The directory containing the SRILM libraries

  • SRILM_INC : The directory containing the SRILM header files

    IMPORTANT: DO NOT change the PYTHON_INC and PERL_INC variables as they are set to be the default values for OS X El Capitan.

  • To compile the python module, run make -f Makefile.osx python and to compile the perl module, run make -f Makefile.osx perl. Note that the compiled modules will only work with the default OS X python and perl interpreters, i.e., /usr/bin/python and /usr/bin/perl.

  • You should be able to run /usr/bin/python test.py and /usr/bin/perl test.pl to test that the modules work and obtain the same output in the Linux case.

Usage:

Usage is clearly illustrated in files test.pl and test.py.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].