Skip to content

Adding an analyzer

cjrd edited this page Jun 29, 2012 · 4 revisions

THIS PAGE IS A WORK IN PROGRESS

This page explains the higher-level steps needed to add an Analyzer to TMA and will use the LDAAnalyzer as a running example: ldaanalyzer.py

  1. Add the analyzer file to TMA/src/backend, e.g. ldaanalyzer.py

  2. Make the analyzer class a subclass of TMAnalyzer and define an initialization that takes a list of parameters as input: from tmanalyzer import TMAnalyzer class LDAAnalyzer(TMAnalyzer): def __init__(self,params): """ implementation goes here"""
    the input parameters should correspond (mostly) to the parameters that will be passed to the topic model software.

  3. Implement the methods do_analysis and create_relations,
    do_analysis should create the topic model from the data
    create_relations should populate the tma database tma.sqlite, which is used to create the output displays -- see ldaanalyzer.py for a template on how to populate the database.

  4. Implement the perplexity determination if applicable (TODO expand this section)

  5. Add the frontend for the analyzer in src/backend/forms.py

  • Add the algorithm to std_algo
  • create the appropriate fields prefixed with the algorithm, e.g. lda_topic_init, lda_alpha, etc
  • create a retriever to retrieve the given fields (see the other retrievers for an example)
  1. Add the algorithm to the algorithm form template under src/templates/algorithm-form.html (follow the example of the other algorithms)

  2. Update the wiki with information about the new topic model. see Topic Models

Clone this wiki locally