Python: check cosine similarity between mongoDB database documents
问题 I am using python. Now I have a mongoDB database collection, in which all documents have such a format: {"_id":ObjectId("53590a43dc17421e9db46a31"), "latlng": {"type" : "Polygon", "coordinates":[[[....],[....],[....],[....],[.....]]]} "self":{"school":2,"home":3,"hospital":6} } In which the field "self" indicates the venue types in the Polygon and the number of corresponding venue types. different documents have different self field, such as {"KFC":1,"building":2,"home":6}, {"shopping mall":1