Code Monkey home page Code Monkey logo

stanford.nlp.net's Introduction

Stanford.NLP for .NET

2024-03-21: All Stanford.NLP NuGet packages are marked as deprecated (legacy and no longer maintained). Please use the official Stanford CoreNLP Maven package instead, along with the IKVM.Maven.Sdk.

Getting started with IKVM.Maven.Sdk

Copy the following lines into your project file:

<ItemGroup>
    <PackageReference Include="IKVM" Version="8.7.5" />
    <PackageReference Include="IKVM.Maven.Sdk" Version="1.6.8" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
    <MavenReference Include="edu.stanford.nlp:stanford-corenlp" Version="4.5.6"/>
    <MavenReference Include="edu.stanford.nlp:stanford-corenlp" Version="4.5.6" Classifier="models" />
</ItemGroup>

First two PackageReferencees add IKVM and IKVM.Maven.Sdk to your project. The MavenReferencees are used to download and compile Stanford CoreNLP .jar files and models.

The next step is to manually load the assembly with models into you process:

var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
var modelsAssemblyPath = Path.Combine(baseDirectory, "edu.stanford.nlp.corenlp_english_models.dll");
Assembly.LoadFile(modelsAssemblyPath);

Previously you have to manually find *.jar file with models, unpack it and temporary change the current directory to the unpacked folder. This is no longer needed with IKVM.Maven.Sdk. The *.jar with models is automatically downloaded and compiled to *.dll with the same name. The only thing that you have to do is it to load this assembly into your process.

You are now ready to use Stanford CoreNLP in your .NET project.

var text = "Kosgi Santosh sent an email to Stanford University. He didn't get a reply.";

// Annotation pipeline configuration
var props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse");
props.setProperty("ner.useSUTime", "false");

var pipeline = new StanfordCoreNLP(props);

// Annotation
var annotation = new Annotation(text);
pipeline.annotate(annotation);

P.S. More samples are available in the Stanford.NLP.NET repository.

Licensing of the code/content of this repo

The source code of this repo(build scripts, integration tests, docs and samples) under the MIT license.

Licensing of NuGet packages

All these software distributions are open source, licensed under the GNU General Public License (v2 or later). Note that this is the full GPL, which allows many free uses, but does not allow its incorporation into any type of distributed proprietary software, even in part or in translation. Commercial licensing is also available; please contact The Stanford Natural Language Processing Group if you are interested.

stanford.nlp.net's People

Contributors

sergey-tihon avatar pblasucci avatar tpetricek avatar forki avatar volhav avatar jayhill avatar ronnieholm avatar davidvadnais 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.