Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nplm.pxd « python « src - github.com/moses-smt/nplm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5cbead7d14d760b7978316f4e18d471515397336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from libcpp.string cimport string
from libcpp.vector cimport vector

cdef extern from "neuralLM.h":
    cdef cppclass c_neuralLM "nplm::neuralLM":
        c_neuralLM()
        void set_normalization(bint)
        void set_map_digits(char)
        void set_log_base(double)
        void read(string filename) except +
        int get_order()
        int lookup_word(string)
        float lookup_ngram(vector[int])
        float lookup_ngram(int *, int)
        void set_cache(int)
        double cache_hit_rate()

cdef class NeuralLM:
    cdef c_neuralLM *thisptr
    cdef int c_lookup_word(self, char *s)
    cdef float c_lookup_ngram(self, int *words, int n)
    cdef readonly int order