-
Notifications
You must be signed in to change notification settings - Fork 26
Adding an analyzer
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
-
Add the analyzer file to TMA/src/backend, e.g.
ldaanalyzer.py -
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. -
Implement the methods
do_analysisandcreate_relations,
do_analysisshould create the topic model from the data
create_relationsshould populate the tma databasetma.sqlite,which is used to create the output displays -- see ldaanalyzer.py for a template on how to populate the database. -
Implement the perplexity determination if applicable (TODO expand this section)
-
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)
-
Add the algorithm to the algorithm form template under
src/templates/algorithm-form.html(follow the example of the other algorithms) -
Update the wiki with information about the new topic model. see Topic Models