edu.stanford.nlp.trees
Class DependencyScoring
java.lang.Object
edu.stanford.nlp.trees.DependencyScoring
public class DependencyScoring
- extends java.lang.Object
Scoring of typed dependencies
- Author:
- danielcer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
goldDeps
public final java.util.List<java.util.Set<TypedDependency>> goldDeps
goldDepsUnlabeled
public final java.util.List<java.util.Set<TypedDependency>> goldDepsUnlabeled
DependencyScoring
public DependencyScoring(java.util.List<java.util.Collection<TypedDependency>> goldDeps)
DependencyScoring
public DependencyScoring(java.lang.String filename)
throws java.io.IOException
- Throws:
java.io.IOException
newInstanceStringEquality
public static DependencyScoring newInstanceStringEquality(java.util.List<java.util.Collection<TypedDependency>> goldDeps)
convertStringEquality
public static java.util.List<java.util.Collection<TypedDependency>> convertStringEquality(java.util.List<java.util.Collection<TypedDependency>> deps)
normalizeNumbers
protected static java.lang.String normalizeNumbers(java.lang.String token)
- Normalize all number tokens to <num> in order to allow
for proper scoring of MSTParser productions.
readDeps
protected static java.util.List<java.util.Collection<TypedDependency>> readDeps(java.lang.String filename)
throws java.io.IOException
- Read in typed dependencies. Warning created typed dependencies are not
backed by any sort of a tree structure.
- Parameters:
filename
-
- Returns:
-
- Throws:
java.io.IOException
score
public DependencyScoring.Score score(java.util.List<java.util.Collection<TypedDependency>> system)
- Score system typed dependencies
- Parameters:
system
-
- Returns:
- a triple consisting of (labeled attachment, unlabeled attachment,
label accuracy)
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException
Stanford NLP Group