Download and install LTP model: LTP which consists of two parts:ltp and ltp_data. Here we make use of ltp_data(in version 3.4.0).
install the sub module by pip:
pip install pyltp
pip install gensim
The LIBSVM model(version 3.23): LIBSVM has already been concluded in ./code.
Usage : run ./code/main.py [syndicator name] [path to ltp_data]
Examples: We put three syndications in './data/input' as examples.
Input & Data format:
Three kinds of input are required:
- payment process : a document with sentences that describe the necessary procedures in payment process.
- API list: a document where each line stands an API of the syndicator.
- API parameter description: each API has a document with each line formed by:
[parameter name]***[parameter description].
All the input files are in the folder: './data/input'.
Put the payment process in './data/input/payDocument', the API list in './data/input/apiList', and the API parameter description in './data/input/apiDescription'.
Name the document of payment process and API list as "[Sindicator name].txt".
For API parameter description, build a directory as "[Syndicator name]" in ./data/input/apiDescription, where each API has a document named as "[API name]-[third payment name]-[post/receive].txt".
In this project we utilized 'Alipay' and 'Wechat' as the third payment.
The prediction result of logic vulnerability prediction is in './data/output/result'