Wiki

Clone wiki

parsimonious-vole / Home

Introduction

Parsimonious Vole is a simplified systemic functional parser.

Dependencies

Pthon libraries:

Usage

The input to PV are the dependency parses produced by Stanford Parser. Currently 2 formats are supported: the XML or STP. The XML file can be produced either by running Stanford parser locally or from online demo version here. The STP file can be generated with magic.parse.stanford_parser.py, see example below.

Specify path to Stanford Parser in the environment variable "STANFORD_PARSER_HOME". Alternatively you can edit configuration.py and specify the path to it.

  • Generating the input file:
    #!python
    
    from magic.parse.stanford_parser import 
    call_stanford_parser_file("/path/to/file/input.txt")
    # generates the STP file next to the TXT file
    
  • Generating a nice HTML with Mood Constituency Graphs:

#!python
from usage import output_analisys_of_parse_bundle_to_file
output_file = "path/to/output.html"
input_file = "path/to/input.stp"
# generates the HTML file with analysis result
output_analisys_of_parse_bundle_to_file(output_file, input_file)
* Generating CSV file for OCD related research:

This is a command line tool which generates a CSV file with OCD related analysis for all STP/XML files located in a given directory. The script file(mood_graph_to_csv.py) is located in usage package and it takes exactly one argument - the path to the folder containing the STP/XML parses (the Stanford Parser output).

#!bash
python mood_graph_to_csv.py path/to/input.stp

  • Mood Parsing:
#!python

from magic.guess.mood import test_mood_graph
sentence_id = 1
path_to_stp_input_file = "/path/to/input.stp"
correct_the_input_file = True
mcg = test_mood_graph(sentence_id, path_to_stp_input_file, correct_the_input_file )
  • Transitivity Parsing:
#!python
from magic.guess.transitivity import parse_transitivity_from_mood_graph
# enriching the MCG with transitivity features
res = parse_transitivity_from_mood_graph(mcg)

Recommendations

If you are in development mode I recommend using Eclipse IDE together with PyDev plugin a plugin for Python.

Future Developments

  • add WSD by PyWSD
  • add TempEx alignment

Notes:

listed @ ohloh.net

Updated