Skip to content

Commit d2e1efb

Browse files
committed
Update README.
1 parent 3736ec4 commit d2e1efb

File tree

3 files changed

+257
-4
lines changed

3 files changed

+257
-4
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
*.bak
2+
13
### https://raw.github.com/github/gitignore/f2ce448f2ba7a092da05482ceca99209127c0884/python.gitignore
24

35
# Byte-compiled / optimized / DLL files
@@ -91,5 +93,3 @@ ENV/
9193

9294
# Rope project settings
9395
.ropeproject
94-
95-

README.md

+116-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,116 @@
1-
# Scripts
2-
Provides useful executable scripts for the Review Graph Mining Project.
1+
# Scripts for Analyzing Review Graphs
2+
[![GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/copyleft/gpl.html)
3+
[![Release](https://img.shields.io/badge/release-0.5.0-brightgreen.svg)](https://github.com/rgmining/script/releases/tag/0.5.0)
4+
5+
[![Logo](https://rgmining.github.io/script/_static/image.png)](https://rgmining.github.io/script/)
6+
7+
This package provides useful scripts to analyze datasets themselves and run
8+
an method for mining review graphs.
9+
10+
11+
## Installation
12+
Use `pip` to install this package.
13+
14+
```sh
15+
$ pip install --upgrade rgmining-script
16+
```
17+
18+
19+
## dataset command
20+
dataset command provides a set of functions to inspect a dataset.
21+
Those functions are divided to two groups, analyzing reviewer information and
22+
analyzing product information.
23+
24+
### Analyzing reviewer information
25+
To analyze reviewer information of a dataset, dataset command provides the
26+
following subcommands:
27+
28+
* retrieve: output the ID of reviewers who review at least one of the given
29+
products,
30+
* active: output the ID of reviewers who review at least threshold items,
31+
* reviewer_size: output the number of reviews of each reviewer who reviews
32+
target products,
33+
* filter: output reviews posted by reviewers whose IDs match the given set of
34+
IDs.
35+
36+
37+
### Analyzing product information
38+
To analyze product information of a dataset, dataset command provides the
39+
following subcommands:
40+
41+
* average: output average rating scores of each product,
42+
* distinct: output distinct product IDs,
43+
* popular: output ID of products of which the member of reviews >= threshold.
44+
* filter: output reviews posted to products of which IDs match the given set of
45+
IDs.
46+
* variance: output variances of reviews for each product.
47+
48+
49+
### Basic usage
50+
The basic usage of this command is
51+
52+
```sh
53+
$ dataset <dataset-specifier> <dataset-parameters> reviewer <subcommand>
54+
```
55+
56+
or
57+
58+
```sh
59+
$ dataset <dataset-specifier> <dataset-parameters> product <subcommand>
60+
```
61+
62+
63+
where the dataset-specifier is a name of the dataset to be analyzed.
64+
It is depended on which libraries you have installed and
65+
`dataset -h` returns a list of available dataset names.
66+
67+
dataset-parameters are optional arguments specified with `--dataset-param` flag.
68+
The `--dataset-param` flag takes a string which connecting key and value with
69+
a single =.
70+
The `--dataset-param` flag can be given multi-times.
71+
You can find what kinds of parameter keys are defined in the dataset you want
72+
to use from documents of function `load` defined in the dataset.
73+
74+
For example, dataset `file` means loading a dataset from a file,
75+
of which each line contains a review in [the JSON format](https://rgmining.github.io/dataset-io/modules/dataset_io.html#review-data).
76+
To load such dataset, use `file` as the dataset-specifier and give the file path
77+
as a dataset-parameter with `file` key, i.e. `--dataset-param file="path/to/file"`.
78+
79+
80+
See [document site](https://rgmining.github.io/script/) for more information
81+
about each subcommand.
82+
83+
84+
## analyze command
85+
analyze command loads a dataset and run a method to find anomalous reviewers
86+
and compute a rating summary of each product.
87+
88+
The basic usage of this command is
89+
90+
```sh
91+
$ analyze <dataset-specifier> <dataset-parameters> <method-specifier> <method-parameters>
92+
```
93+
94+
The dataset-specifier and datasset-parameters are the same parameters described
95+
in the dataset command explanation.
96+
97+
The method-specifier is a name of installed method.
98+
You can see available method names by `analyze -h`.
99+
100+
method-parameters are optional arguments specified with `--method-param` flag.
101+
The `--method-param` flag takes a string which connecting key and value with
102+
a single =, and can be given multi-times.
103+
104+
You can find what kinds of parameter keys are defined in the method you want
105+
to run from documents of the constructor of the review graph object defined in
106+
the method.
107+
108+
For example, [Fraud Eagle](https://rgmining.github.io/fraud-eagle) takes one
109+
parameter `epsilon` and you can give a value by `--method-param epsilon=0.25`.
110+
111+
See [document site](https://rgmining.github.io/script/) for more information.
112+
113+
114+
## License
115+
This software is released under The GNU General Public License Version 3,
116+
see [COPYING](https://github.com/rgmining/script/blob/master/COPYING) for more detail.

README.rst

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
Scripts for Analyzing Review Graphs
2+
===================================
3+
4+
|GPLv3| |Release|
5+
6+
|Logo|
7+
8+
This package provides useful scripts to analyze datasets themselves and
9+
run an method for mining review graphs.
10+
11+
Installation
12+
------------
13+
14+
Use ``pip`` to install this package.
15+
16+
.. code:: sh
17+
18+
$ pip install --upgrade rgmining-script
19+
20+
dataset command
21+
---------------
22+
23+
dataset command provides a set of functions to inspect a dataset. Those
24+
functions are divided to two groups, analyzing reviewer information and
25+
analyzing product information.
26+
27+
Analyzing reviewer information
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29+
30+
To analyze reviewer information of a dataset, dataset command provides
31+
the following subcommands:
32+
33+
- retrieve: output the ID of reviewers who review at least one of the
34+
given products,
35+
- active: output the ID of reviewers who review at least threshold
36+
items,
37+
- reviewer\_size: output the number of reviews of each reviewer who
38+
reviews target products,
39+
- filter: output reviews posted by reviewers whose IDs match the given
40+
set of IDs.
41+
42+
Analyzing product information
43+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
45+
To analyze product information of a dataset, dataset command provides
46+
the following subcommands:
47+
48+
- average: output average rating scores of each product,
49+
- distinct: output distinct product IDs,
50+
- popular: output ID of products of which the member of reviews >=
51+
threshold.
52+
- filter: output reviews posted to products of which IDs match the
53+
given set of IDs.
54+
- variance: output variances of reviews for each product.
55+
56+
Basic usage
57+
~~~~~~~~~~~
58+
59+
The basic usage of this command is
60+
61+
.. code:: sh
62+
63+
$ dataset <dataset-specifier> <dataset-parameters> reviewer <subcommand>
64+
65+
or
66+
67+
.. code:: sh
68+
69+
$ dataset <dataset-specifier> <dataset-parameters> product <subcommand>
70+
71+
where the dataset-specifier is a name of the dataset to be analyzed. It
72+
is depended on which libraries you have installed and ``dataset -h``
73+
returns a list of available dataset names.
74+
75+
dataset-parameters are optional arguments specified with
76+
``--dataset-param`` flag. The ``--dataset-param`` flag takes a string
77+
which connecting key and value with a single =. The ``--dataset-param``
78+
flag can be given multi-times. You can find what kinds of parameter keys
79+
are defined in the dataset you want to use from documents of function
80+
``load`` defined in the dataset.
81+
82+
For example, dataset ``file`` means loading a dataset from a file, of
83+
which each line contains a review in `the JSON
84+
format <https://rgmining.github.io/dataset-io/modules/dataset_io.html#review-data>`__.
85+
To load such dataset, use ``file`` as the dataset-specifier and give the
86+
file path as a dataset-parameter with ``file`` key, i.e.
87+
``--dataset-param file="path/to/file"``.
88+
89+
See `document site <https://rgmining.github.io/script/>`__ for more
90+
information about each subcommand.
91+
92+
analyze command
93+
---------------
94+
95+
analyze command loads a dataset and run a method to find anomalous
96+
reviewers and compute a rating summary of each product.
97+
98+
The basic usage of this command is
99+
100+
.. code:: sh
101+
102+
$ analyze <dataset-specifier> <dataset-parameters> <method-specifier> <method-parameters>
103+
104+
The dataset-specifier and datasset-parameters are the same parameters
105+
described in the dataset command explanation.
106+
107+
The method-specifier is a name of installed method. You can see
108+
available method names by ``analyze -h``.
109+
110+
method-parameters are optional arguments specified with
111+
``--method-param`` flag. The ``--method-param`` flag takes a string
112+
which connecting key and value with a single =, and can be given
113+
multi-times.
114+
115+
You can find what kinds of parameter keys are defined in the method you
116+
want to run from documents of the constructor of the review graph object
117+
defined in the method.
118+
119+
For example, `Fraud Eagle <https://rgmining.github.io/fraud-eagle>`__
120+
takes one parameter ``epsilon`` and you can give a value by
121+
``--method-param epsilon=0.25``.
122+
123+
See `document site <https://rgmining.github.io/script/>`__ for more
124+
information.
125+
126+
License
127+
-------
128+
129+
This software is released under The GNU General Public License Version
130+
3, see
131+
`COPYING <https://github.com/rgmining/script/blob/master/COPYING>`__ for
132+
more detail.
133+
134+
.. |GPLv3| image:: https://img.shields.io/badge/license-GPLv3-blue.svg
135+
:target: https://www.gnu.org/copyleft/gpl.html
136+
.. |Release| image:: https://img.shields.io/badge/release-0.5.0-brightgreen.svg
137+
:target: https://github.com/rgmining/script/releases/tag/0.5.0
138+
.. |Logo| image:: https://rgmining.github.io/script/_static/image.png
139+
:target: https://rgmining.github.io/script/

0 commit comments

Comments
 (0)