Skip to content

Commit

Permalink
Turn into an installable package.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdusell committed Dec 16, 2016
1 parent 8cf8662 commit 961980e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__pycache__/
*.pyc
*.swp
/build/
/dist/
/rougescore.egg-info/
1 change: 1 addition & 0 deletions rougescore/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .rougescore import rouge_n, rouge_1, rouge_2, rouge_3, rouge_l

This comment has been minimized.

Copy link
@CauchyTaylorEuler

CauchyTaylorEuler May 21, 2022

what is it mean?

7 changes: 5 additions & 2 deletions rougescore.py → rougescore/rougescore.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from __future__ import division
import collections

import six

def _ngrams(words, n):
queue = collections.deque([], n)
queue = collections.deque(maxlen=n)
for w in words:
queue.append(w)
if len(queue) == n:
Expand All @@ -15,7 +18,7 @@ def _ngram_count(words, n):

def _counter_overlap(counter1, counter2):
result = 0
for k, v in counter1.items():
for k, v in six.iteritems(counter1):
result += min(v, counter2[k])
return result

Expand Down
40 changes: 40 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from setuptools import setup, find_packages
import os
import codecs

base_dir = os.path.abspath(os.path.dirname(__file__))

with codecs.open(os.path.join(base_dir, 'README.md'), encoding='utf-8') as fin:
long_description = fin.read()

setup(
name='rougescore',
version='0.1.0',
description='Python implementation of ROUGE',
long_description=long_description,
url='https://github.com/bdusell/rougescore',
author='Brian DuSell',
author_email='bdusell@gmail.com',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.0',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering'
],
keywords='nlp rouge summarization evaluation',
packages=['rougescore'],
install_requires=['six']
)

0 comments on commit 961980e

Please sign in to comment.