Skip to content

Instantly share code, notes, and snippets.

@klintan
Created September 7, 2018 22:37
Show Gist options
  • Save klintan/54b2dc4afd68e63e3bb9a40977027873 to your computer and use it in GitHub Desktop.
Save klintan/54b2dc4afd68e63e3bb9a40977027873 to your computer and use it in GitHub Desktop.
Truthfinder 3
def compute_confidence(df, objects, source_trust, attribute_key):
# compute claims confidence score
all_objects_data = pd.DataFrame()
for obj in objects:
data = df[df['object'] == obj]
# Sub-step 1. compute from source trust
data, confidence = compute_confidence_score(data, source_trust, attribute_key)
# Sub-step 2. similarity between claims
data, confidence = compute_confidence_score_with_similarity(data, confidence, attribute_key)
# Sub-step 3. compute the adjusted confidence
data, confidence = compute_final_confidence(data, confidence)
# concatenate all objects
all_objects_data = pd.concat([all_objects_data, data])
return all_objects_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment