当前位置: 首页>>代码示例>>Python>>正文


Python stanford.StanfordNERTagger方法代码示例

本文整理汇总了Python中nltk.tag.stanford.StanfordNERTagger方法的典型用法代码示例。如果您正苦于以下问题:Python stanford.StanfordNERTagger方法的具体用法?Python stanford.StanfordNERTagger怎么用?Python stanford.StanfordNERTagger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nltk.tag.stanford的用法示例。


在下文中一共展示了stanford.StanfordNERTagger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from nltk.tag import stanford [as 别名]
# 或者: from nltk.tag.stanford import StanfordNERTagger [as 别名]
def __init__(self):#, ner_dir, pos_dir, ft_dir):

		#MODELS_DIR, FASTTEXT_DIR, POS_DIR, NER_DIR, MUSIC_XML_DIR
		FASTTEXT_DIR = "fastText"
		MUSIC_DATABASE = "music_metadata.json"
		
		self.snt = StanfordNERTagger('stanford-ner/voiceai-ner.ser.gz', 'models/../stanford-ner/stanford-ner.jar')
		self.spt = StanfordPOSTagger('stanford-pos/voiceai_bi.tagger', 'models/../stanford-pos/stanford-postagger.jar') 
#		self.spt = StanfordPOSTagger('/run/media/vidur/Kachra/edu/stanford/nlp/models/pos-tagger/english-caseless-left3words-distsim.tagger', 'models/../stanford-pos/stanford-postagger.jar') 

		self.tyc = TypeClassifier("fastText/voiceai.bin", FASTTEXT_DIR+"/fasttext")#"fastText/voiceai.bin")

		self.controls = []
		self.controls.append(MusicControl(MUSIC_DATABASE))
		self.controls.append(HardwareControl())
		self.controls.append(ConversionControl())

		self.qsc = QuestionControl()

		self.my_name = "Halzee"
		self.age = 16
		self.creator = "Vidur" 
开发者ID:vidursatija,项目名称:voiceai,代码行数:24,代码来源:voiceai.py

示例2: getTheNamedEntities

# 需要导入模块: from nltk.tag import stanford [as 别名]
# 或者: from nltk.tag.stanford import StanfordNERTagger [as 别名]
def getTheNamedEntities(text):
    st = StanfordNERTagger(StanfordNERClassifierPath, StanfordNERjarPath)

    lstTag = st.tag(text.split())

    result = {}
    for tag in lstTag:
        #if str(tag[1]).lower() != 'o': #### CAUTION - DROPPING the General Term 'Object' items
        result [str(str(tag[0])).replace('.','')] = str(tag[1])
        
    return result

#Returns the expanded URL from links such as bit.ly
#[input: string] [output: string] 
开发者ID:N1h1l1sT,项目名称:Data-Mining-From-Twitter,代码行数:16,代码来源:index.py

示例3: __init__

# 需要导入模块: from nltk.tag import stanford [as 别名]
# 或者: from nltk.tag.stanford import StanfordNERTagger [as 别名]
def __init__(self, cs_model, transi_matrix, tags, local_config=None):
        if local_config is None:
            local_config = copy.deepcopy(CONFIGS)
        self.cs_model = cs_model
        self.transi_matrix = transi_matrix
        self.tags = tags
        self.local_config = local_config
        self.lang1_tagger = StanfordNERTagger(local_config["lang1_class"],
                                              local_config["class_jar"])
        self.lang2_tagger = StanfordNERTagger(local_config["lang2_class"],
                                              local_config["class_jar"]) 
开发者ID:Bilingual-Annotation-Task-Force,项目名称:python-tagger,代码行数:13,代码来源:evaluator.py

示例4: getTheNamedEntities

# 需要导入模块: from nltk.tag import stanford [as 别名]
# 或者: from nltk.tag.stanford import StanfordNERTagger [as 别名]
def getTheNamedEntities(text):
    st = StanfordNERTagger('C:\Progs\stanfordNER\classifiers\english.all.3class.distsim.crf.ser.gz', 'C:\Progs\stanfordNER\stanford-ner.jar') 
    result = st.tag(text.split())

    return result

#Returns the expanded URL from links such as bit.ly
#[input: string] [output: string] 
开发者ID:N1h1l1sT,项目名称:Data-Mining-From-Twitter,代码行数:10,代码来源:Part2_functions.py


注:本文中的nltk.tag.stanford.StanfordNERTagger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。