使用 Google 地理编码 API 将命名实体识别标记的文件链接到 Google 地图
我有使用 NER 标记的文本文件,我需要将它们链接到 Google 地图。
<p>Gardai|NNP|O fear|VBP|O a|DT|O 28-year-old|JJ|O man|NN|O ,|,|O missing|VBG|O from|IN|O his|PRP$|O Dublin|NNP|I-PER home|NN|O for|IN|O a|DT|I-DAT week|NN|I-DAT
尽管位置没有正确标记,即。都柏林被标记为一个人,我想使用 Google Geocoding API,输入被识别为 NER 标记的位置并找到该位置!
这可能吗?
我正在考虑创建一个正则表达式来提取标记为位置、组织或个人的任何信息,并将其提供给 Google,看看它是否具有与其相对应的纬度和经度坐标。或者取出一行中标记为 NER 的 2-3 个单词,并将它们添加为整个地址。
我只是不确定如何将这些信息提供给 Google!?
然后,我将使用 Json 响应,使用 Google Geocoder 匹配的地址将文本文件链接到地图。
任何见解或想法将不胜感激! 谢谢
I have text files which are tagged using NER and I need to link them to a Google map.
<p>Gardai|NNP|O fear|VBP|O a|DT|O 28-year-old|JJ|O man|NN|O ,|,|O missing|VBG|O from|IN|O his|PRP$|O Dublin|NNP|I-PER home|NN|O for|IN|O a|DT|I-DAT week|NN|I-DAT
Although locations are not tagged correctly ie. Dublin is tagged as a person, I want to use the Google Geocoding API, to feed in the location which is identified as being NER tagged and find the location!
Is this possible?
I was thinking of creating a regex to extract any information which is tagged as a location, organisation or person and give it to Google and see if it has a latitude and longitude co-ordinatea that corresponds to it. Or take the 2-3 words in a row that are tagged as NER and add them as an entire address.
I'm just not sure about how I actually give this information to Google!?
Then I'm going to use the Json response to link the text file to the map using the address Google Geocoder matched.
Any insight or ideas would be greatly appreciated!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 JavaScript 的 Split 函数 来获取分隔符为
|
并将数据转换为数组。假设您的数据是这种 html 格式:要获取分隔符设置为
|
的数据,您可以使用 JavaScript 执行以下操作:这是 JSFiddle 演示。使用 firefox 上的 firebug 或 google chrome 的控制台工具,您可以看到数据输出,如果您需要创建标记和地理编码的帮助,请告诉我。
You can use JavaScript's Split function to get the data with delimiter being
|
and turn the data into an array. Let's say if your data is this html format:To grab the data w/ delimiter set to
|
you can do the following with JavaScript:Here is the JSFiddle Demo. Using firebug on firefox or google chrome's console tool you can see the data output, and if you need help w/ creation of markers and Geocode please let me know.