Coder Social home page Coder Social logo

anukat2015 / factorie Goto Github PK

View Code? Open in Web Editor NEW

This project forked from factorie/factorie

0.0 3.0 0.0 44.95 MB

FACTORIE is a toolkit for deployable probabilistic modeling, implemented as a software library in Scala. It provides its users with a succinct language for creating relational factor graphs, estimating parameters and performing inference.

License: Apache License 2.0

Makefile 0.08% Shell 0.67% Emacs Lisp 2.29% Scala 96.40% Lex 0.56%

factorie's Introduction

FACTORIE

Build Status

This directory contains the source of FACTORIE, a toolkit for probabilistic modeling based on imperatively-defined factor graphs. More information, see the FACTORIE webpage.

Installation

Installation relies on Maven, version 3. If you don't already have maven, install it from http://maven.apache.org/download.html. Alternatively, you can use sbt as outlined below (a script for running sbt comes bundled with Factorie).

To compile type

$ mvn compile

To accomplish the same with sbt, type

$ ./sbt compile

You might need additional memory. If so, for sbt type

export SBT_OPTS="$SBT_OPTS -Xmx1g"

and for Maven type:

export MAVEN_OPTS="$MAVEN_OPTS -Xmx1g -XX:MaxPermSize=128m"

To create a self-contained .jar, that contains FACTORIE plus all its dependencies, including the Scala runtime, type

$ mvn -Dmaven.test.skip=true package -Pjar-with-dependencies

To accomplish the same with sbt, type

$ ./sbt assembly

To create a similar self-contained .jar that also contains all resources needed for NLP (including our lexicons and pre-trained model parameters), type

$ mvn -Dmaven.test.skip=true package -Pnlp-jar-with-dependencies

To accomplish the same with sbt, type

$ ./sbt -J-Xmx2G with-nlp-resources:assembly

##Try out a simple example

To get an idea what a simple FACTORIE program might look like, open one of the class files in the tutorial package

$ ls src/main/scala/cc/factorie/tutorial

To run one of these examples using maven type

$ mvn scala:run -DmainClass=cc.factorie.tutorial.Grid

Try out implemented NLP models

Then you can run some FACTORIE tools from the command-line. For example, you can run many natural language processing tools.

$ bin/fac nlp --wsj-forward-pos --conll-chain-ner

will launch an NLP server that will perform part-of-speech tagging and named entity recognition in its input. The server listens for text on a socket, and spawns a parallel document processor on each request. To feed it input, type in a separate shell

$ echo "I told Mr. Smith to take a job at IBM in Raleigh." | nc localhost 3228

You can also run a latent Dirichlet allocation (LDA) topic model. Assume that "mytextdir" is a directory name containing many plain text documents each in its own file. Then typing

$ bin/fac lda --read-dirs mytextdir --num-topics 20 --num-iterations 100

will run 100 iterations of a sparse collapsed Gibbs sampling on all the documents, and print out the results every 10 iterations. FACTORIE's LDA implementation is faster than MALLET's.

You can also train a document classifier. Assume that "sportsdir" and "politicsdir" are each directories that contain plan text files in the categories sports and politics. Typing

$ bin/fac classify --read-text-dirs sportsdir,politicsdir --write-classifier mymodel.factorie

will train a log-linear by maximum likelihood (MaxEnt) and save it in the file "mymodel.factorie".

The above are simply a few simple command-line options. Internally the FACTORIE library contains extensive and general facilities for factor graphs: data representation, model structure, inference, learning.

factorie's People

Contributors

andrewmccallum avatar alextp avatar lvilnis avatar jacksullivan avatar strubell avatar brianmartin avatar davidbelanger avatar caitlincell avatar michaelwick avatar oskarsinger avatar craigacp avatar vineetmundhra avatar samanz avatar dirkweissenborn avatar jeevanshankar1991 avatar sameersingh avatar nmonath avatar k8si avatar akobre01 avatar karlschultz avatar timvieira avatar pogren avatar harshal-pandya avatar adamchandra avatar malcolmgreaves avatar dozed avatar peschue avatar antonbakalov avatar oscartackstrom avatar riedelcastro avatar

Watchers

James Cloos avatar anukat2015 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.