Documentation ¶
Overview ¶
Package wikiassignment provides utility functions for automatically assigning wikipedia pages to topics.
Index ¶
Constants ¶
View Source
const ( //TopicNamespaceID represents topic namespace ID TopicNamespaceID = 6666 //CategoryNamespaceID represents category namespace ID in Wikipedia dumps CategoryNamespaceID = 14 //ArticleNamespaceID represents article namespace ID in Wikipedia dumps ArticleNamespaceID = 0 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Filter ¶
Filter represents a filter to be applied to the semantic graph before the transformation into assignment
type SemanticGraphSources ¶
type SemanticGraphSources struct { Dumps func(string) (io.ReadCloser, error) TopicAssignments map[uint32][]uint32 Filters []Filter }
SemanticGraphSources represents the data sources needed to build the wikipedia semantic graph
func (SemanticGraphSources) Build ¶
func (p SemanticGraphSources) Build(ctx context.Context) (g map[uint32][]uint32, ids2CatDistance map[uint32]uint32, namespace2Ids map[int]*roaring.Bitmap, err error)
Build returns the semantic graph, the distance in hops from any node to the closer topic and a map from namespaces ID to pages ID.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.