|
3 年之前 | |
---|---|---|
.. | ||
nlp-engine @ 7d5a8d4e5f | 9ab7af2102 HPCC-27117 nlp plugin fails to build on osx | 3 年之前 |
CMakeLists.txt | 72fab49096 HPCC-25212 Add support for unity builds in CMake | 3 年之前 |
README.md | 7102047dbe HPCC-27097 NLP Plugin: Fails to execute sample code | 3 年之前 |
lib_nlp.ecllib | a27ce31abf HPCC-25884 Add Plugin for NLP++ Analyzers | 3 年之前 |
nlp.cpp | 8a1bcffeba HPCC-27143 NLP Plugin: ECL function declaration vs C++ function mismatch | 3 年之前 |
nlp.hpp | a27ce31abf HPCC-25884 Add Plugin for NLP++ Analyzers | 3 年之前 |
nlp_eng.cpp | 5f65bf51dc HPCC-27117 nlp plugin fails to build on osx | 3 年之前 |
nlp_eng.hpp | a27ce31abf HPCC-25884 Add Plugin for NLP++ Analyzers | 3 年之前 |
This plugin exposes nlp-engine to ECL. It is a wrapper around VisualText's nlp-engine:
The nlp plugin has a dependency on https://github.com/VisualText/nlp-engine which has been added to the HPCC-Platform repository as a git submodule. To install:
git submodule update --init --recursive
Import the nlp plugin library to analyze a text into its syntactic parse tree which is returned as an XML string:
IMPORT nlp from lib_nlp;
text01 := 'The quick brown fox jumped over the lazy boy.';
parsedtext01 := nlp.AnalyzeText('parse_en-us',text01);
output(parsedtext01);
text02 := 'TAI has bought the American Medical Records Processing for more than $130 million dollars.';
parsedtext02 := nlp.AnalyzeText('corporate',text02);
output(parsedtext02);
text03 := 'Right middle lobe consolidation compatible with acute pneumonitis.';
parsedtext03 := nlp.AnalyzeText('parse_en-us',text03);
output(parsedtext03);
text04 := 'TAI\'s stock is up 4% from $58.33 a share to $60.66.';
parsedtext04 := nlp.AnalyzeText('corporate',text04);
output(parsedtext04);
STRING AnalyzeText(CONST VARSTRING analyzerName, CONST VARSTRING textToAnalyze)
Runs the analyzer on the passed text and returns and XML string from the analyzer. The first time an analyzer is called, it is initialized and subsequent calls to that analyzer will run with the analyzer already in memory.
Returns the text that is from the output in the specified NLP++ analyzer.