📄 attributeextraction.java
字号:
package edu.umass.cs.mallet.projects.seg_plus_coref.coreference;import java.util.*;import java.lang.*;import java.io.*;public abstract class AttributeExtraction{ ArrayList fileList; String attributeStartTag; String attributeEndTag; boolean includeSingleton = true; static String[] SEPERATOR = new String[] {"<NEW_HEADER>", "<NEWREFERENCE>"}; public AttributeExtraction(ArrayList fileList, String attributeStartTag, String attributeEndTag, boolean includeSingleton) { this.fileList = fileList; this.attributeStartTag = attributeStartTag; this.attributeEndTag = attributeEndTag; this.includeSingleton = includeSingleton; } public abstract int processOnePaper(File file); public double attributeExtraction() { int count = 0; for(int i=0; i<fileList.size(); i++){ File file = (File)fileList.get(i); int index = processOnePaper(file); if(index == 0) count++; else{ // if(index != -1) // System.out.println("ERRORS:" + file.toString() + ":" + index); } } double accuracy = (double)count/fileList.size(); return accuracy; } public String toString() { return this.getClass().getName(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -