Package pylearn :: Package datasets :: Package embeddings :: Module process
[hide private]

Module process

source code

Read in the weights file

Functions [hide private]
 
length()
Returns: The length of embeddings
source code
 
word_to_embedding(w) source code
 
read_embeddings() source code
 
preprocess_word(origw)
Convert a word so that it can be embedded directly.
source code
 
preprocess_seq(l)
Convert a sequence so that it can be embedded directly.
source code
Variables [hide private]
  __words = None
  __word_to_embedding = None
  __read = False
  numberre = re.compile(r'[0-9]')
  slashre = re.compile(r'\\/')

Imports: string, sys, NUMBER_OF_WORDS, UNKNOWN, VOCABFILE, DIMENSIONS, WEIGHTSFILE, re


Function Details [hide private]

length()

source code 
Returns:
The length of embeddings

preprocess_word(origw)

source code 

Convert a word so that it can be embedded directly. Returned the preprocessed sequence.

Note: Preprocessing is appropriate for Penn Treebank style documents. #@note: Perhaps run common.penntreebank.preprocess on the word first.

preprocess_seq(l)

source code 

Convert a sequence so that it can be embedded directly. Returned the preprocessed sequence.

Note: Preprocessing is appropriate for Penn Treebank style documents.