prb977/cooccurrence_count
0
1---2title: Cooccurrence Count3datasets:4- 5tags:6- evaluate7- measurement8description: "TODO: add a description here"9sdk: gradio10sdk_version: 3.0.211app_file: app.py12pinned: false13---14 15# Measurement Card for Cooccurrence Count16 17## Measurement Description18The `cooccurence_count` measurement returns the total count of sentences in data and the co-occurrence count of the two words passed19 20## How to Use21This measuresment requires a list of strings as input data along with two strings as word1 and word222```python23>>> data = ["hello sun","hello moon", "hello sun"]24>>> c_count = evaluate.load("prb977/cooccurrence_count")25>>> results = c_count.compute(data=data, word1='hello', word2='sun')26>>> 27```28 29### Inputs30- **data** (list of `str`): The input list of strings31- **word1** (`str`): The first word32- **word2** (`str`): The second word33 34### Output Values35- **count** (`int`): The total count of sentences in data.36- **co_occurrence_count** (`int`): The count of co-occurrence of word1 and word2 in the sentences of data.37 38### Examples39```python40>>> data = ["hello sun","hello moon", "hello sun"]41>>> c_count = evaluate.load("prb977/cooccurrence_count")42>>> results = c_count.compute(references=data, word1='hello', word2='sun')43>>> print(results)44{'count': 3, 'co_occurrence_count': 2}45```46 