File size: 1,294 Bytes
d9d9c5c
 
4d57961
 
 
 
 
 
d9d9c5c
4d57961
d9d9c5c
 
 
 
4d57961
 
 
1d4befc
4d57961
 
1d4befc
 
 
 
0a442a2
1d4befc
 
4d57961
 
1d4befc
 
 
4d57961
 
1d4befc
 
4d57961
 
1d4befc
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: Cooccurrence Count
datasets:
-  
tags:
- evaluate
- measurement
description: "TODO: add a description here"
sdk: gradio
sdk_version: 3.0.2
app_file: app.py
pinned: false
---

# 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
```python
>>> 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
```python
>>> 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}
```