0

I wanted to post the highlighted annotation of a document [highlighted using GATE developer tool] to new file [either word or Excel]. Can someone help me with any suggestions or this? Thanks in Advance.

Regards, Gayatri

2 Answers2

0

Sorry, I can't comment yet...

Similar question here Read annotated data from GATE datastore

The provided answer (By Ian Roberts) has means to store selected annotations in files.

Suggestion: Use GATE embedded (with Java).

Community
  • 1
  • 1
0

Reading annotated documents in html is fairly straight forward. You can follow the instructions for printing which can be executed using a text editor. Remember to select the annotations you wish to display and save the artifact using the ‘Save Preserving Format’. The resulting xml will have the annotation tags you select embedded in the saved document.

You can also visualize in html.

<!DOCTYPE html>
<div id="topContent">
  <h1>Report Example</h1>
  <p>
This example provide a visualization of a annotated document produced by GATE using ANNIE with defaults. To use with Javascript, the document can be formatted as an xml document using xmlHttpRequest.
  </p>
</div>
<div id="pageView">
  <div id="legendView">
<h3>Document Legend</h3>
<div>
  <table id="annotationTable">
    <tr>
      <th>Facet</th>
      <th>Color</th>
    </tr>
    <tr>
      <td>Date</td>
      <td id="dateFill"></td>
    </tr>
    <tr>
      <td>Location</td>
      <td id="locationFill"></td>
    </tr>
    <tr>
      <td>Organization</td>
      <td id="organizationFill"></td>
    </tr>
    <tr>
      <td>Person</td>
      <td id="personFill"></td>
    </tr>
  </table>
  </div>
  </div>
  <p>..Add GATE XML contents here..</p>
</div>

Once the html is set up, add the css:

body {}
table, th, td {
  border: 1px solid black;
  text-align: center;
  font-family: arial;
}
#annotationTable {
  border-collapse: collapse;
  width: 10%;
}
#topContent {
  font: 18px arial;
}
#pageView {
  border: 1px solid black;
  font: 14px arial;
}
#legendView {
  margin: 10px 10px 10px 10px;
}
#dateFill {background-color: rgb(51, 255, 119)}
#locationFill {background-color: rgb(204, 153, 255)}
#organizationFill {background-color: rgb(102, 255, 255)}
#personFill {background-color: rgb(255, 204, 153)}
Date {background-color: rgb(51, 255, 119)}
Location {background-color: rgb(204, 153, 255)}
Organization {background-color: rgb(102, 255, 255)}
Person {background-color: rgb(255, 204, 153)}

This provides a basic view of the GATE annotations. Of course it can be more complicated depending on what you are trying to express. See the Fiddle

To view in MS Word:

  1. Open the saved annotated xml file in MS Word.
  2. Add the css file to the same directory where the annotated document is stored.
  3. Open the Developer Tab in Word.
  4. Select the Document Template icon.
  5. Select the Linked CSS tab, navigate to the location of the annotated document and css file.
  6. Add the css file to the Linked Style Sheets.
  7. Save the document as a Web Page.
  8. Navigate to where you saved the html page and open in your favorite browser.
  9. Ensure that you have selected Print Background Colors and Images from the Page Setup.
  10. Print for a highlighted document.

Kind of a pain in the butt but it works if you want a printed copy. The document will not present css in Word. I hope this helps.