NeuralPhraseEmbedding
Implementation of Phrase Embedding methods.
Install / Use
/learn @bgnkim/NeuralPhraseEmbeddingREADME
Neural Phrase Embedding v0.0.1-SNAPSHOT
Overview
This package includes JAVA implementation of (Socher et al., NIPS 2011), and intermediate vector extraction of (Socher et al., ACL 2013).
Currently, this contains just trained results of the paper, but we planned to add other implemetations, such as:
- Stacked Denoised Auto Encoder
- Recursive Auto Encoder in (Socher et al., NIPS 2011)
- Unfolding Recursive Auto Encoder in (Socher et al., NIPS 2011)
Usage
Because jar with dependency file is not uploaded, you need to run maven install first.
If not, before this package is published in Maven repository, you need to specify dependencies of this package, which are declared in pom.xml.
Run Demo Program
To see how it works, you can simply run the jar file, with following shell script on /NeuralPhraseEmbedding directory:
maven clean install
java -jar ./NPE-latest-jar-with-dependencies.jar
Then it automatically launches StanfordWrapper class. All you need to do is type the phrase when Phrase? prompt is shown.
Javadocs
This package contains javadoc jar file, NPE-latest-javadoc.jar.
Basic Usage
Here is the sample code of StanfordWrapper main method
public static void main(String[] args) {
final StanfordWrapper instance = StanfordWrapper.getInstance();
final Scanner scan = new Scanner(System.in);
String line;
do {
System.out.print("Phrase? ");
line = scan.nextLine();
// Generate Parse Tree from Stanford RNN Parser.
final Tree tree = instance.parseTree(line);
// Get Phrase Vector(URAE)
final SimpleMatrix matrix = instance.getPhraseVectorOf(tree);
// If you want to get Syntactic Phrase Vector,
// final SimpleMatrix matrix = instance.getSyntacticScoreVectorOf(tree);
// If you want to get Syntactic Weight Matrix of that,
// final SimpleMatrix matrix = instance.getSyntacticWeightMatrixOf(tree);
System.out.println(matrix.toString());
System.out.println(tree.toString());
} while (line.length() > 0);
scan.close();
}
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
