|
| 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