Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module provides a handy wrapper around the CoreNLP project's command-line utility https://nlp.stanford.edu/software/corenlp.html , and a parser for some of its output formats.
- launchCoreNLP :: FilePath -> [Text] -> IO [Either String Document]
- parseJsonDoc :: Text -> Either String Document
- data Dependency = Dependency {
- dep :: Text
- governor :: Int
- governorGloss :: Text
- dependent :: Int
- dependentGloss :: Text
- data Entitymention = Entitymention {
- docTokenBegin :: Int
- docTokenEnd :: Int
- tokenBegin :: Int
- tokenEnd :: Int
- text :: Text
- characterOffsetBegin :: Int
- characterOffsetEnd :: Int
- ner :: Text
- normalizedNER :: Maybe Text
- data Token = Token {}
- data Sentence = Sentence {
- index :: Int
- parse :: Text
- basicDependencies :: [Dependency]
- enhancedDependencies :: [Dependency]
- enhancedPlusPlusDependencies :: [Dependency]
- entitymentions :: [Entitymention]
- tokens :: [Token]
- data Coref = Coref {}
- type CorefsId = Text
- type Corefs = HashMap CorefsId [Coref]
- data Document = Document {}
- test :: IO ()
Documentation
:: FilePath | Path to the directory where you extracted the CoreNLP project |
-> [Text] | List of inputs |
-> IO [Either String Document] | List of parsed results |
Launch CoreNLP with your inputs. This function will put every piece of Text
in a separate file, launch CoreNLP subprocess, and parse the results
parseJsonDoc :: Text -> Either String Document Source #
Parse JSON output of CoreNLP. See headlines
source for an example JSON input.
data Dependency Source #
Dependency | |
|
data Entitymention Source #
Entitymention | |
|
Sentence | |
|