Ejemplo n.º 1
0
def audio_parse(filename):
    text_list = audio_convert(filename)
    if(len(text_list) == 0):
        return([None] * 16)
    full_text =  ' ' + ' '.join(text_list) + ' '
    full_parse = get_features(full_text)
    full_text.lower()

    # print full_parse
    # print full_text

    # print stopwords.words('english')

    # Remove stopwords when recording the text
    for w in stopwords.words('english') + ['like']:
        full_text = full_text.replace(' ' + w + ' ', ' ')

    # print full_text
    full_parse.append(full_text.strip())
    return full_parse
Ejemplo n.º 2
0
#!/usr/local/bin/python

from nltk_features import get_features 
import sys

# When running it stepwise I will just type in a few example sentences.

print sys.argv
filename = sys.argv[1]
story = file(filename, 'r')
story_text = story.read()
story.close()

test_features = get_features(story_text)
print(test_features)