View Javadoc

1   /*
2    * Copyright (C) 2004-2006 Christian Siefkes <christian@siefkes.net>.
3    * Development of this software is supported by the German Research Society,
4    * Berlin-Brandenburg Graduate School in Distributed Information Systems
5    * (DFG grant no. GRK 316).
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, visit
19   * http://www.gnu.org/licenses/gpl.html or write to the Free Software
20   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21   */
22  package de.fu_berlin.ties.extract.amend;
23  
24  import java.util.List;
25  
26  import de.fu_berlin.ties.ContextMap;
27  import de.fu_berlin.ties.ProcessingException;
28  import de.fu_berlin.ties.context.ContextDetails;
29  import de.fu_berlin.ties.extract.ExtractionContainer;
30  
31  /***
32   * Implemtations of this interface signal that they are able to re-analyse the
33   * all extractions in a document and perform suitable amendments to improve
34   * results.
35   *
36   * @author Christian Siefkes
37   * @version $Revision: 1.7 $, $Date: 2006/10/21 16:04:15 $, $Author: siefkes $
38   */
39  public interface FinalReextractor {
40  
41      /***
42       * Re-extract all extractions in a document at the end of the document,
43       * considering the complete states of all tokens.
44       *
45       * @param originalExtractions the original extractions predicted for this
46       * document
47       * @param contextDetails a list of context details representing all
48       * tokens in the document
49       * @param context a map of context object provided by the combination
50       * strategy
51       * @return the predicted extractions
52       * @throws ProcessingException if an error occurs during processing
53       */
54      ExtractionContainer reextract(final ExtractionContainer originalExtractions,
55          final List<ContextDetails> contextDetails, final ContextMap context)
56      throws ProcessingException;
57  
58      /***
59       * Trains the re-extractor on a document.
60       *
61       * @param answerKeys the true extractions to train for this document
62       * @param contextDetails a list of context details representing all
63       * tokens in the document
64       * @param context a map of context object provided by the combination
65       * strategy
66       * @throws ProcessingException if an error occurs during processing
67       */
68      void train(final ExtractionContainer answerKeys,
69          final List<ContextDetails> contextDetails, final ContextMap context)
70      throws ProcessingException;
71  
72  }