Giter Site home page Giter Site logo

framenet-python's Introduction

FrameNet in Python

I'm now maintaining Patrick Ye's Python library for accessing FrameNet data. This version works with FrameNet version 1.3.

Getting Started

First you must obtain and install the FrameNet XML files, which are free for non-commerical and require an application. Then, you can obtain the Python Library and run:

python setup.py build
sudo python setup.py install

Second, you should set your FRAMENET_HOME environment variable to point to where you installed and uncompressed FrameNet's XML files. (Alternatively you can edit the FRAMENET_PATH constant in framenet/settings.py).

Then you can test your installation by running python test/importer.py or by opening a Python shell and typing:

import framenet
fn = framenet.FrameNet()

The first time you instantiate the FrameNet class, it will parse all of the XML files and save pickle objects. You should see:

Loading the frames ... Framenet not initialized, doing it now
Loading xml for frames ...

The first time you do this it will take a while, so go have a coffee or celebrate your next birthday.

Common Functions

  • FrameNet.lookupLexicalUnit(text, part_of_speech)

You can look up frames by the lexical units (e.g., words) and their parts of speech. For example:

buy = fn.lookupLexicalUnit('buy','v')
  • FrameNet.lookupFrame(frame)

Also, you can look up FrameNet frames by their name:

commerce_frame = fn.lookupFrame('Commerce_buy')

framenet-python's People

Contributors

dasmith avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.