{"id":24539,"library":"rouge-chinese","title":"rouge-chinese","description":"A Python implementation of ROUGE score specifically designed for Chinese text evaluation. It supports both character-level and word-level ROUGE-1, ROUGE-2, and ROUGE-L metrics. Version 1.0.3 is the latest, with no recent updates (last release likely 2021).","status":"active","version":"1.0.3","language":"python","source_language":"en","source_url":"https://github.com/Isaac-JL-Chen/rouge_chinese","tags":["nlp","rouge","chinese","evaluation","text-summarization"],"install":[{"cmd":"pip install rouge-chinese","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for Chinese word segmentation","package":"jieba","optional":false},{"reason":"Compatibility with Python 2/3","package":"six","optional":true}],"imports":[{"note":"The correct import is from rouge_chinese, not the generic 'rouge' package.","wrong":"import rouge","symbol":"rouge","correct":"from rouge_chinese import Rouge"}],"quickstart":{"code":"from rouge_chinese import Rouge\n\n# Example hypotheses and references (Chinese text)\nhypotheses = [\"这是一个测试句子\"]\nreferences = [\"这是一个参考句子\"]\n\nrouge = Rouge()\nscores = rouge.get_scores(hypotheses, references)\nprint(scores)","lang":"python","description":"Basic usage computing ROUGE scores for Chinese text."},"warnings":[{"fix":"Use 'from rouge_chinese import Rouge' instead of 'import rouge'.","message":"The library 'rouge-chinese' is commonly confused with 'rouge' (the general ROUGE implementation). Importing from 'rouge' instead of 'rouge_chinese' will import a different library with different API.","severity":"breaking","affected_versions":"all"},{"fix":"Access scores via scores[0]['rouge-1']['f'] and similar.","message":"The library returns scores as a dictionary with keys like 'rouge-1', 'rouge-2', 'rouge-l', but the output format differs from the original 'rouge' library. The 'f' key is present but some users expect 'f1-score'.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider pinning dependencies (jieba==0.42.1) or switching to 'rouge' library with proper Chinese tokenization.","message":"The library has not been updated since 2021 and may have compatibility issues with newer Python versions (e.g., Python 3.10+). It relies on 'jieba' which may change its API.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install rouge-chinese and import as 'from rouge_chinese import Rouge'.","cause":"Wrong import: using 'import rouge' instead of 'from rouge_chinese import Rouge'.","error":"AttributeError: module 'rouge' has no attribute 'Rouge'"},{"fix":"Call as 'rouge.get_scores(hypotheses, references)' with two lists.","cause":"Passing arguments incorrectly; the API expects (hypotheses, references) as lists of strings.","error":"TypeError: get_scores() takes 3 positional arguments but 4 were given"},{"fix":"Install jieba: 'pip install jieba'.","cause":"Missing dependency jieba required for Chinese word segmentation.","error":"ImportError: No module named 'jieba'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}