Entity Relations from freebase dump

落爺英雄遲暮 提交于 2019-12-06 13:44:46

问题


I want to dump all entity-name-pair with a relation.

Example :

subject predicate object
<freebase/ns/g.11bc7__xnw>  <freebase/ns/people.place_lived.location>   <freebase/ns/m.02_286>  .

Freebase in above line refers to url of freebase website. I extracted all triplets which have mid in subject and object, then I took the predicate as the relation.

For the above example my code will output something like this:

entity pair : g.11bc7__xnw , m.02_286
relation : people.place_lived.location

I have two issues:

  1. when I ran my code on freebase dump I got 14887 relations but the actual number of relations in freebase are more than 25,000 .
  2. for some mid's, there is no property name or alias. (/type/object/name, /common/topic/alias)

Please tell me what I am doing wrong.


回答1:


Well, some relations to not point to a mid, but to a basic value:

<http://rdf.freebase.com/ns/g.11vjz1ynm> <http://rdf.freebase.com/ns/measurement_unit.dated_percentage.date> "2001-02"

And that's basically the entire measurement_unit domain.

Then, the mids that don't have name and alias sound like cvt's (compound value types) which are artificial nodes that hold a complex relationship (eg. node to node + time).

So I think you should account better for measurements, booleans, dates, etc. and cvts.



来源:https://stackoverflow.com/questions/40786524/entity-relations-from-freebase-dump

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!