-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Taqi Jaffri
committed
Mar 13, 2024
1 parent
db5f98a
commit 9592d58
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
|
||
from docugami_dfm_benchmarks.utils.similarity import compute_f1 | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"text1,text2,expected_f1", | ||
[ | ||
("This is a test", "This is a test", 1.0), # Exact match | ||
("One two a three", "one two three", 1.0), # Exact match modulo article, whitespace and casing | ||
("One two a three", " four five a six", 0.0), # No match | ||
], | ||
) | ||
def test_compute_f1(text1: str, text2: str, expected_f1: float) -> None: | ||
assert compute_f1(text1, text2) == expected_f1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters