def __init__(self, entityTypes, labelList=[]): """ Create a new mention finder to find a given list of mention types. entityTypes = list of mention types to find (e.g. group, outcome) """ BaseMentionFinder.__init__(self, entityTypes) self.simpleTagger = 'java -cp ' + self.classpath \ + ' cc.mallet.fst.SimpleTagger' self.labelSet = set(labelList)
def __init__(self, entityTypes, randomSeed, recall=1.0): """ Create a finder that labels tokens with a given type if they have this annotation. entityType = the mention types to find (e.g. group, outcome) recall = desired recall of mention finder [0,1] """ BaseMentionFinder.__init__(self, entityTypes) self.recall = recall self.randomSeed = randomSeed self.finderType = 'random'
def __init__(self, entityTypes, labelFeatures=[]): """ Create a new mention finder to find a given list of mention types. entityTypes = list of mention types to find (e.g. group, outcome) binaryClassification = True if a separate classifier is to be trained for each mention type. """ BaseMentionFinder.__init__(self, entityTypes) self.simpleTagger = 'java -cp ' + self.classpath \ + ' cc.mallet.fst.SimpleTagger' self.labelFeatures = set(labelFeatures)
def __init__(self, entityTypes, tokenClassifier, labelFeatures=[], useReport=True, tokenFilter=None, randomSeed=42): """ Create a new mention finder to find a given list of mention types. entityTypes = list of mention types to find (e.g. group, outcome) """ BaseMentionFinder.__init__(self, entityTypes, tokenClassifier) self.useReport = useReport self.commonLemmas['group'] = set(['group', 'control', 'placebo', 'treatment']) self.commonLemmas['outcome'] = set(['cure', 'recover', 'improve', 'mortality', 'morbidity', 'die', 'adverse', 'event']) self.dependencyPaths = {} self.labelSet = set(labelFeatures) self.tokenFilter = tokenFilter self.randomSeed = randomSeed random.seed(self.randomSeed)
def __init__(self, entityTypes): """ Create a new mention finder to find a given list of mention types """ BaseMentionFinder.__init__(self, entityTypes, None) self.finderType = 'banner'
def __init__(self, entityTypes): """ Create a finder that labels tokens using rules entityTypes = the mention types to find (e.g. group, outcome) """ BaseMentionFinder.__init__(self, entityTypes, tokenClassifier=None)