Spaces:
Runtime error
Runtime error
Prabin Bhandari
commited on
Commit
·
1d4befc
1
Parent(s):
e0ee438
Update readme
Browse files
README.md
CHANGED
@@ -14,37 +14,32 @@ pinned: false
|
|
14 |
|
15 |
# Measurement Card for Cooccurrence Count
|
16 |
|
17 |
-
***Module Card Instructions:*** *Fill out the following subsections. Feel free to take a look at existing measurement cards if you'd like examples.*
|
18 |
-
|
19 |
## Measurement Description
|
20 |
-
|
21 |
|
22 |
## How to Use
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
|
27 |
### Inputs
|
28 |
-
|
29 |
-
- **
|
|
|
30 |
|
31 |
### Output Values
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
*State the range of possible values that the measurement's output can take, as well as what in that range is considered good. For example: "This measurement can take on any value between 0 and 100, inclusive. Higher scores are better."*
|
36 |
-
|
37 |
-
#### Values from Popular Papers
|
38 |
-
*Give examples, preferrably with links to leaderboards or publications, to papers that have reported this measurement, along with the values they have reported.*
|
39 |
|
40 |
### Examples
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
## Further References
|
50 |
-
*Add any useful further references.*
|
|
|
14 |
|
15 |
# Measurement Card for Cooccurrence Count
|
16 |
|
|
|
|
|
17 |
## Measurement Description
|
18 |
+
The `cooccurence_count` measurement returns the total count of sentences in data and the co-occurrence count of the two words passed
|
19 |
|
20 |
## How to Use
|
21 |
+
This measuresment requires a list of strings as input data along with two strings as word1 and word2
|
22 |
+
```python
|
23 |
+
>>> data = ["hello sun","hello moon", "hello sun"]
|
24 |
+
>>> c_count = evaluate.load("prb977/cooccurrence_count")
|
25 |
+
>>> results = c_count.compute(references=data, word1='hello', word2='sun')
|
26 |
+
>>>
|
27 |
+
```
|
28 |
|
29 |
### Inputs
|
30 |
+
- **data** (list of `str`): The input list of strings
|
31 |
+
- **word1** (`str`): The first word
|
32 |
+
- **word2** (`str`): The second word
|
33 |
|
34 |
### Output Values
|
35 |
+
- **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 |
### Examples
|
39 |
+
```python
|
40 |
+
>>> 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 |
+
```
|
|
|
|
|
|