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

Add text length #116

Merged
merged 16 commits into from
Sep 27, 2024
Merged

Add text length #116

merged 16 commits into from
Sep 27, 2024

Conversation

Wenshansilvia
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.82%. Comparing base (e7726c7) to head (391dedb).
Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
rageval/metrics/base.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #116      +/-   ##
==========================================
+ Coverage   82.42%   82.82%   +0.39%     
==========================================
  Files          34       35       +1     
  Lines        1178     1205      +27     
==========================================
+ Hits          971      998      +27     
  Misses        207      207              
Flag Coverage Δ
82.82% <96.96%> (+0.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


# Metrics about the answer informativeness

Copy link
Collaborator

Choose a reason for hiding this comment

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

建议文件夹的名字写”answer_informativeness“


def __repr__(self) -> str:
""":return: Formatted string representation of the metric."""
return f"{self.ALIAS[0]}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

这一行后面添加一下注释:”# pragma: no cover“可以跳过codecov的覆盖率检测,避免项目的覆盖率降低 PR不过~

logger = logging.getLogger(__name__)


class Tokenizer(ABC):
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个tokenizer只有一个__init__函数,就不用写成一个类了,感觉在用的时候直接实例调用就可以了


ALIAS = ['text_length']

def __init__(self, tokenize_model: str = "Qwen/Qwen2-0.5B-Instruct"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

感觉你这里是不是Tokenizer不用写一个类,直接在 class TextLength里面一个成员就好了

@Wenshansilvia Wenshansilvia merged commit 8347f79 into main Sep 27, 2024
3 checks passed
@bugtig6351 bugtig6351 deleted the add_text_length branch October 2, 2024 12:41
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.

3 participants