public class RelationSyntacticEmbeddingFeatureExtractor extends Object implements RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>
Constructor and Description |
---|
RelationSyntacticEmbeddingFeatureExtractor(String vecFile) |
Modifier and Type | Method and Description |
---|---|
List<Double> |
addVectors(List<Double> vector1,
WordVector vector2)
Add two vectors.
|
double |
computeCosineSimilarity(List<Double> vector1,
List<Double> vector2) |
double |
computeCosineSimilarity(WordVector vector1,
WordVector vector2)
Compute cosine similarity between two vectors.
|
List<org.cleartk.ml.Feature> |
extract(org.apache.uima.jcas.JCas jCas,
IdentifiedAnnotation arg1,
IdentifiedAnnotation arg2)
Extract features for the pair of named entity mentions.
|
public RelationSyntacticEmbeddingFeatureExtractor(String vecFile) throws org.cleartk.ml.feature.extractor.CleartkExtractorException
org.cleartk.ml.feature.extractor.CleartkExtractorException
public List<org.cleartk.ml.Feature> extract(org.apache.uima.jcas.JCas jCas, IdentifiedAnnotation arg1, IdentifiedAnnotation arg2) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
RelationFeaturesExtractor
extract
in interface RelationFeaturesExtractor<IdentifiedAnnotation,IdentifiedAnnotation>
jCas
- The JCas containing the two named entity mentions.arg1
- The first identified annotation in the text.arg2
- The second identified annotation in the text.org.apache.uima.analysis_engine.AnalysisEngineProcessException
public double computeCosineSimilarity(WordVector vector1, WordVector vector2)
public double computeCosineSimilarity(List<Double> vector1, List<Double> vector2)
public List<Double> addVectors(List<Double> vector1, WordVector vector2)
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.