Commit 57d7224e authored by Kathryn Elliott's avatar Kathryn Elliott

Changed to using argparse. Added logging.

* Changed code to add argparse for command line
* Added logging handler to write INFO messages
or higher to standard error
parent fed05458
......@@ -3,11 +3,43 @@
import sys
import json
import pandas
import argparse
import logging
from pprint import pprint
from topic_model import TopicModel
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
# define a Handler which writes INFO messages or higher to the sys.stderr
console = logging.StreamHandler()
# set a format which is simpler for console use
formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
# tell the handler to use this format
# add the handler to the root logger
parser = argparse.ArgumentParser(description='Process some files.')
parser.add_argument('filenames', metavar='filename', type=str, nargs='+',
help='One or more files for the parser')
parser.add_argument('--min', type=int, default=5,
help='Setting the minimum topic count')
parser.add_argument('--max', type=int, default=20,
help='Setting the max topic count')
args = parser.parse_args()
logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d %(threadName)s %(message)s')
extra_stopwords = ['would', 'be', 're', 'edu', 'use', 'get', 'say', 'do', 'could']
extra_non_stopwords = ['to', 'go', 'not']
def load_data(dataset_file):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment