Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/n/l/nlpnet-1.0.4/nlpnet/taggers.py   nlpnet(Download)
    else:
        net_class = Network
    nn = net_class.load_from_file(config.FILES[md.network])
 
    logger.info('Loading features')
    type_features = utils.load_features_from_file(config.FILES[md.type_features])
    tables = [type_features]
 
    if md.use_caps:
        caps_features = utils.load_features_from_file(config.FILES[md.caps_features])
        tables.append(caps_features)
    if md.use_suffix:
        suffix_features = utils.load_features_from_file(config.FILES[md.suffix_features])
        tables.append(suffix_features)
    if md.use_pos:
        pos_features = utils.load_features_from_file(config.FILES[md.pos_features])

src/n/l/nlpnet-1.0.4/nlpnet/utils.py   nlpnet(Download)
def count_pos_tags():
    """Counts and returns how many POS tags there are."""
    with open(config.FILES['pos_tag_dict']) as f:
        td = cPickle.load(f)
    return len(td)
 
def count_chunk_tags():
    """Counts and returns how many chunk tags there are."""
    with open(config.FILES['chunk_tag_dict']) as f:
    else:
        logger.info("Loading word type features...")
        types_table = load_features_from_file(config.FILES[md.type_features])
 
        if len(types_table) < len(text_reader.word_dict):
        if args.load_network:
            logger.info("Loading capitalization features...")
            caps_table = load_features_from_file(config.FILES[md.caps_features])
        else:
            logger.info("Generating capitalization features...")
        if args.load_network:
            logger.info("Loading suffix features...")
            suffix_table = load_features_from_file(config.FILES[md.suffix_features])
        else:
            logger.info("Generating suffix features...")

src/n/l/nlpnet-1.0.4/nlpnet/reader.py   nlpnet(Download)
    def load_dictionary(self):
        """Reads a dictionary from a pickled file."""
        logger = logging.getLogger("Logger")
        logger.info("Loading provided dictionary...")
        filename = config.FILES['word_dict_dat']
    def save_word_dict(self):
        """Saves the reader's word dictionary in cPickle format."""
        logger = logging.getLogger("Logger")
 
        with open(config.FILES['word_dict_dat'], 'wb') as f:
            cPickle.dump(self.word_dict, f, 2)
 
        logger.info("Dictionary saved in %s" % config.FILES['word_dict_dat'])
        """
        key = '%s_tag_dict' % self.task
        with open(config.FILES[key], 'w') as f:
            cPickle.dump(self.tag_dict, f)
 
        if filename is None:
            key = '%s_tag_dict' % self.task
            filename = config.FILES[key]
 
        with open(filename, 'rb') as f:

src/n/l/nlpnet-1.0.4/nlpnet/attributes.py   nlpnet(Download)
        logger = logging.getLogger("Logger")
        try:
            with open(config.FILES['suffixes'], 'rb') as f:
                for line in f:
                    suffix = unicode(line.strip(), 'utf-8')
        suffix_list = [e for e, n in common_endings if n >= min_occurrences]
 
        with open(config.FILES['suffixes'], 'wb') as f:
            for suffix in suffix_list:
                f.write('%s\n' % suffix.encode('utf-8'))