prb977/cooccurrence_count
0
Measurement Card for Cooccurrence Count
Measurement Description
The cooccurence_count measurement returns the total count of sentences in data and the co-occurrence count of the two words passed
How to Use
This measuresment requires a list of strings as input data along with two strings as word1 and word2
>>> data = ["hello sun","hello moon", "hello sun"]
>>> c_count = evaluate.load("prb977/cooccurrence_count")
>>> results = c_count.compute(data=data, word1='hello', word2='sun')
>>> Inputs
- data (list of
str): The input list of strings - word1 (
str): The first word - word2 (
str): The second word
Output Values
- count (
int): The total count of sentences in data. - co_occurrence_count (
int): The count of co-occurrence of word1 and word2 in the sentences of data.
Examples
>>> data = ["hello sun","hello moon", "hello sun"]
>>> c_count = evaluate.load("prb977/cooccurrence_count")
>>> results = c_count.compute(references=data, word1='hello', word2='sun')
>>> print(results)
{'count': 3, 'co_occurrence_count': 2}