graphid.api module

class graphid.api.GraphID[source]

Bases: NiceRepr

Public API for the Graph ID algorithm

Example

>>> # DISABLE_DOCTEST
>>> for query in iter(self):
>>>     feedback = oracle.review(query)
>>>     self.add_feedback(feedback)
add_annots_from(annots)[source]
add_edges_from(edges)[source]
add_edge(edge, evidence_decision=None)[source]
peek(n=0)[source]

Look at the next n items in the priority queue. When n=0 we only return one item, otherwise we return a list of items. (Note: We only make gaurentees about the first)

subgraph(aids)[source]
pccs()[source]

Positive Connected Components

Yeilds:
list: list of aids indicating all annotations currently predicted

to be some specific individual / category.

list : list of aids : Current prediction of individuals.

is_consistent()[source]
Returns:

if any PCC contains a

Return type:

bool

add_feedback(edge, **kwargs)[source]

Adds the information from a review to the graph for consideration in the dynamic inference algorithm.