def removeLabels(self, labelList=[]): """ For each token in the list of abstracts, if it has been assigned a label in a given list of labels, remove it. if no list of labels is given, remove all labels. """ for abstract in self.__list: for sentence in abstract.allSentences(): sentence.templates = None sentence.annotatedTemplates = None for token in sentence: token.removeAllLabels(labelList)
def cleanupAnnotations(self): """ Cleanup minor annotation inconsistencies in the current list of abstracts. """ determinerSet = set(['a', 'the', 'an']) for abstract in self.__list: for sentence in abstract.allSentences(): for token in sentence: nextToken = token.nextToken() if nextToken != None: # add determiner at beginning of mention if not already there if token.text in determinerSet: typeList = ['group', 'outcome'] for type in typeList: token.copyAnnotation(nextToken, type) if token.text == 'with': token.copyAnnotation(nextToken, 'condition')
def cleanupAnnotations(self): """ Cleanup minor annotation inconsistencies in the current list of abstracts. """ determinerSet = set(["a", "the", "an"]) for abstract in self.__list: for sentence in abstract.allSentences(): for token in sentence: nextToken = token.nextToken() if nextToken != None: # add determiner at beginning of mention if not already there if token.text in determinerSet: typeList = ["group", "outcome"] for type in typeList: token.copyAnnotation(nextToken, type) if token.text == "with": token.copyAnnotation(nextToken, "condition")