Closed llxbush closed 3 years ago
i have solved the problem ,but i cant get any output
C:\Users\llx\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
[]
entitylinker = core.MLLinker(path_to_model='C:/Users/llx/Desktop/entity-linking/starsem2018-entity-linking-master/trainedmodels/FeatureModel_SimplifiedVCG.torchweights')
output = entitylinker.link_entities_in_raw_input("barack obama is a president.")
print(output.entities)
the console shows that:
C:\Users\llx\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
File "c:\Users\llx\Desktop\entity-linking\starsem2018-entity-linking-master\entitylinking\core\entity_linker.py", line 130, in link_entities_in_raw_input
sentence = self.link_entities_in_sentence_obj(sentence, element_id=element_id, num_candidates=num_candidates)
File "c:\Users\llx\Desktop\entity-linking\starsem2018-entity-linking-master\entitylinking\core\entity_linker.py", line 77, in link_entities_in_sentence_obj
caseless=sentence_obj.input_text.islower())
File "c:\Users\llx\Desktop\entity-linking\starsem2018-entity-linking-master\entitylinking\utils.py", line 133, in get_tagged_from_server
properties={corenlp_properties, corenlp_caseless} if caseless else corenlp_properties
AttributeError: 'str' object has no attribute 'get'
warnings.warn(warning.format(ret)) Traceback (most recent call last): File "c:/Users/llx/Desktop/entity-linking/starsem2018-entity-linking-master/test.py", line 8, in