<commit_before>import unittest
from kilogram.dataset.dbpedia import DBPediaOntology
from kilogram.entity_types.prediction import NgramTypePredictor
from kilogram import NgramService


class TestTyping(unittest.TestCase):
    ngram_predictor = None

    def setUp(self):
        NgramService.configure(hbase_host=('diufpc304', 9090), subst_table='typogram')
        dbpedia_ontology = DBPediaOntology('fixtures/dbpedia_2015-04.owl')
        self.ngram_predictor = NgramTypePredictor('typogram', dbpedia_ontology)

    def test_main(self):
        print self.ngram_predictor.predict_types("I went NONE NONE NONE".split())
<commit_msg>tests<commit_after>import unittest
from kilogram.dataset.dbpedia import DBPediaOntology
from kilogram.entity_types.prediction import NgramTypePredictor
from kilogram import NgramService


class TestTyping(unittest.TestCase):
    ngram_predictor = None

    def setUp(self):
        NgramService.configure(hbase_host=('diufpc304', 9090), subst_table='typogram')
        dbpedia_ontology = DBPediaOntology('fixtures/dbpedia_2015-04.owl')
        self.ngram_predictor = NgramTypePredictor('typogram', dbpedia_ontology)

    def test_main(self):
        print self.ngram_predictor.predict_types("I went NONE NONE NONE".split())
        print self.ngram_predictor.predict_types_features("I went NONE NONE NONE".split())

{'fraction_non_alphanumeric': 0.08834446919079436, 'fraction_numerical': 0.019302152932442463, 'mean_word_length': 5.18348623853211, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6791106', 'n_tokens_mistral': 463, 'n_tokens_neox': 434, 'n_words': 78}