cooccurrence_count / README.md
Prabin Bhandari
Minor updates
0a442a2
|
raw
history blame
1.29 kB
metadata
title: Cooccurrence Count
datasets:
  - null
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

>>> 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}