Beispiel #1
0
 def test_mobileclick_download_training_data(self):
     '''
     Download a subset of the full training data
     '''
     import os
     from mobileclick.scripts.mobileclick_download_training_data import main
     files = [
         './data/MC2-training/en/1C2-E-iunits.tsv', 
         './data/MC2-training-documents/1C2-E.HTML/1C2-E-0001-1.html'
         ]
     # check if files have been downloaded
     if not all([os.path.exists(f) for f in files]):
         main(istest=True)
         # files to be downloaded
         for f in files:
             self.assertTrue(os.path.exists(f))
Beispiel #2
0
    def test_mobileclick_random_ranking_method(self):
        '''
        Random ranking method
        '''
        from mobileclick.scripts.mobileclick_random_ranking_method import main
        queryfilepath = create_query_subset(
            './data/MC2-training/en/1C2-E-queries.tsv',
            './data/MC2-training-documents/1C2-E.INDX/')

        main(['--runname', 'test',
            '--query', queryfilepath,
            '--iunit', './data/MC2-training/en/1C2-E-iunits.tsv',
            '--index', './data/MC2-training-documents/1C2-E.INDX/',
            '--pagedir', './data/MC2-training-documents/1C2-E.HTML/',
            '--outputdir', './runs'])

        drop_tmp_files()
Beispiel #3
0
    def test_mobileclick_lang_model_summarization_method(self):
        '''
        Lang Model summarization method
        '''
        from mobileclick.scripts.mobileclick_lang_model_summarization_method import main
        queryfilepath = create_query_subset(
            './data/MC2-training/en/1C2-E-queries.tsv',
            './data/MC2-training-documents/1C2-E.INDX/')
        intentfilepath = create_tmp_intent_file(queryfilepath)

        main(['--runname', 'test',
            '--query', queryfilepath,
            '--iunit', './data/MC2-training/en/1C2-E-iunits.tsv',
            '--index', './data/MC2-training-documents/1C2-E.INDX/',
            '--intent', intentfilepath,
            '--pagedir', './data/MC2-training-documents/1C2-E.HTML/',
            '--outputdir', './runs',
            '--language', 'english'])

        drop_tmp_files()