def bibclassify_exhaustive_call_text(text, taxonomy, rebuild_cache=False, no_cache=False, output_mode='text', output_limit=20, spires=False, match_mode='full', with_author_keywords=False, extract_acronyms=False, only_core_tags=False): """Call to bibclassify on a text.""" output_mode = output_mode.split(",") if not isinstance(text, list): text = [text] return engine.get_keywords_from_text( text_lines=text, taxonomy_name=taxonomy, rebuild_cache=rebuild_cache, no_cache=no_cache, output_mode=output_mode, output_limit=output_limit, spires=spires, match_mode=match_mode, with_author_keywords=with_author_keywords, extract_acronyms=extract_acronyms, only_core_tags=only_core_tags, api=True)
def run_microtest_suite(test_cases, results={}, plevel=1): """Runs all tests from the test_case @var test_cases: microtest definitions @keyword results: dict, where results are cummulated @keyword plevel: int [0..1], performance level, results below the plevel are considered unsuccessful @return: nothing """ config = {} if 'config' in test_cases: config = test_cases['config'] del (test_cases['config']) if 'taxonomy' not in config: config['taxonomy'] = ['HEP'] for test_name in sorted(test_cases.keys()): test = test_cases[test_name] try: log.debug('section: %s' % test_name) phrase = test['phrase'][0] (skw, ckw, akw, acr) = engine.get_keywords_from_text(test['phrase'], config['taxonomy'][0], output_mode="raw") details = analyze_results(test, (skw, ckw)) if details["plevel"] < plevel: log.error("\n" + format_test_case(test)) log.error("results\n" + format_details(details)) else: log.info("Success for section: %s" % (test_name)) log.info("\n" + format_test_case(test)) if plevel != 1: log.info("results\n" + format_details(details)) results.setdefault(test_name, []) results[test_name].append(details) except Exception as msg: log.error('Operational error executing section: %s' % test_name) #log.error(msg) log.error(traceback.format_exc())
def bibclassify_exhaustive_call_text(text, taxonomy, rebuild_cache=False, no_cache=False, output_mode='text', output_limit=20, spires=False, match_mode='full', with_author_keywords=False, extract_acronyms=False, only_core_tags=False): """Call to bibclassify on a text.""" output_mode = output_mode.split(",") if not isinstance(text, list): text = [text] return engine.get_keywords_from_text(text_lines=text, taxonomy_name=taxonomy, rebuild_cache=rebuild_cache, no_cache=no_cache, output_mode=output_mode, output_limit=output_limit, spires=spires, match_mode=match_mode, with_author_keywords=with_author_keywords, extract_acronyms=extract_acronyms, only_core_tags=only_core_tags, api=True)