Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: faithfulness for unrelated answering #340

Merged
merged 28 commits into from Nov 27, 2023

Conversation

shahules786
Copy link
Member

No description provided.

@shahules786
Copy link
Member Author

shahules786 commented Nov 27, 2023

Thanks to @Yongtae723 for bringing this issue up :)

from ragas.metrics import  faithfulness
data={'question': 'What is the economic significance of New York City?',
 'ground_truths': ["New York City's economic significance is vast, as it serves as the global financial capital, housing Wall Street and major financial institutions. Its diverse economy spans technology, media, healthcare, education, and more, making it resilient to economic fluctuations. NYC is a hub for international business, attracting global companies, and boasts a large, skilled labor force. Its real estate market, tourism, cultural industries, and educational institutions further fuel its economic prowess. The city's transportation network and global influence amplify its impact on the world stage, solidifying its status as a vital economic player and cultural epicenter."],
 'answer': 'idk what the fuck.',
 "contexts":["New York City's most important economic sector lies in its role as the headquarters for the U.S. financial industry, metonymously known as Wall Street. The city's securities industry continues to form the largest segment of the city's financial sector and is an important economic engine. Many large financial companies are headquartered in New York City, and the city is also home to a burgeoning number of financial startup companies."]
}
  
faithfulness.score_single(data)

@shahules786
Copy link
Member Author

@Yongtae723 Would you like to play with it and see if it holds up to your adversarial testing? Feel free to modify if not :)

Copy link
Contributor

@Yongtae723 Yongtae723 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't check but I feel LGTM except minor point!

I will report after testing

src/ragas/metrics/_faithfulness.py Outdated Show resolved Hide resolved
Co-authored-by: Yong723 <50616781+Yongtae723@users.noreply.github.com>
@shahules786
Copy link
Member Author

Thank you @Yongtae723

@shahules786 shahules786 merged commit 4138abc into explodinggradients:main Nov 27, 2023
15 checks passed
@Yongtae723
Copy link
Contributor

I tested and confirmed it works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants