Created
September 7, 2018 22:37
-
-
Save klintan/54b2dc4afd68e63e3bb9a40977027873 to your computer and use it in GitHub Desktop.
Truthfinder 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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