Package edu.pitt.dbmi.nlp.noble.coder.model

Examples of edu.pitt.dbmi.nlp.noble.coder.model.Document


    htmlExporter = new HTMLExporter(outputDir);
    csvExporter = new CSVExporter(outputDir);
   
    for(int i=0;i<files.size();i++){
      progress("processing report ("+(processCount+1)+") "+files.get(i).getName()+" ... \n");
      Document doc = coder.process(files.get(i));
      processTime += coder.getProcessTime();
     
      // now output HTML for this report
      htmlExporter.export(doc);
      csvExporter.export(doc);
View Full Code Here


    ((NobleCoderTerminology)nc.getTerminology()).setSelectBestCandidate(true);
   
    for(File file : new File("/home/tseytlin/Data/DeepPhe/"+domain+"/sample/deid/").listFiles()){
      if(file.getName().endsWith(".txt")){
        System.out.print("processing\t"+file.getName()+"\t..\t");
        Document doc = nc.process(file);
        PrintStream out = new PrintStream(new File(file.getParentFile(),file.getName()+".processed"));
        out.println(doc.getTitle());
        out.println("---------------------------------------");
        for(Object prop : doc.getProperties().keySet()){
          out.println(prop+"\t->\t"+doc.getProperties().get(prop));
        }
        out.println("---------------------------------------");
        for(Sentence s: doc.getSentences()){
          String sec = s.getSection() != null?s.getSection().getTitle():"none";
          String tm = s.getProperties().containsKey("time")?s.getProperties().get("time"):"";
          out.println("sentence:\t|"+s.getOffset()+"|\t"+s.getSentenceType()+"|\t"+sec+"|\t"+s+"\t|"+tm);
          //System.out.println("extracted:\t"+doc.getText().substring(s.getStartPosition(),s.getEndPosition()));
          for(Mention m: s.getMentions()){
View Full Code Here

   * @throws IOException
   * @throws FileNotFoundException
   * @throws TerminologyException
   */
  public Document process(File document) throws FileNotFoundException, IOException, TerminologyException {
    Document doc = new Document(TextTools.getText(new FileInputStream(document)));
    doc.setLocation(document.getAbsolutePath());
    doc.setTitle(document.getName());
    return process(getDocumentProcessor().process(doc));
  }
View Full Code Here

TOP

Related Classes of edu.pitt.dbmi.nlp.noble.coder.model.Document

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.