Commit f9f5cfd9 authored by Bruno López Trigo's avatar Bruno López Trigo

Eliminado directorio wekaparser e actualizado o README

parent d8377663
......@@ -27,20 +27,24 @@ ExpliClas code is available on: https://gitlab.citius.usc.es/bruno.lopez.trigo/E
The demo web service code is available under /codigo/expliclas.
The API REST code is available under /codigo/expliclas-api.
## HOW IT WORKS
ExpliClas is a web service composed of an REST API and a web demo. The REST API is served as a tomcat service that can be called independently, without the need to use the web demo interface. The web demo depends directly on the REST API, taking into account that the web demo is a support to make use of the API easily. So when deploying ExpliClas, keep in mind that to use the web demon you must first install the API.
## HOW TO BUILD AND DEPLOY
### Prerequisites
- Install NetBeans IDE (version 8.2)
- Install Apache Tomcat (version 9.0.12)
- Install NodeJS (version 10.13)
- Install NPM (version 6.4.1)
- Install Maven (version 3.5.2 or higher)
- Install Apache Tomcat (version 9.0.12 or higher)
- Install NodeJS (version 10.13 or higher)
- Install NPM (version 6.4.1 or higher)
### Building and deploying the API
1. Add Apache Tomcat server to NetBeans IDE http://wiki.netbeans.org/AddExternalTomcat
2. Open [ExpliClas API Maven Project](/codigo/expliclas-api) on NetBeans IDE.
3. Run the project with NetBeans. By default API will be deployed at http://localhost:8080/api.
1. Go to [ExpliClas API Maven Project](/codigo/expliclas-api) directory.
2. Run the maven command `mvn compile war:war`. This will compile project and generate a war file in [target directory](/codigo/expliclas-api/target).
3. Deploy the generated war file in your tomcat server.
If you wish to change the default API base URL:
......@@ -67,6 +71,20 @@ const ui = SwaggerUIBundle({
});
```
3. Also you will need to change at [SessionService.java](/codigo/expliclas-api/src/main/java/brunolopez/expliclas/services/SessionService.java) the base URL to make Swagger documentation methods work correctly.
```java
servers = {
@Server(
url = "http://localhost:8080/api" // CHANGE API BASE URL
)
}
```
#### NOTES:
- The name of the war implies changes to the previous URLs, for example if war is _ExpliClas.war_ the url would be _http://localhost:8080/ExpliClas/api_.
### Building and deploying the demo web service
If you have changed the API base URL, the go to the [demo config](/codigo/expliclas/src/config.js) to be sure API URL's match.
......@@ -80,3 +98,25 @@ export const API_DOC = "http://localhost:8080/";
2. Run `npm install -g serve` to install a NodeJS server for deployment.
3. Run `npm run build` to generate a web service ready to production.
4. Run `serve -s -l PORT build` to run the web service in the specified PORT.
#### NOTES:
- You may need to change the homepage URL at [package.json](/codigo/expliclas/package.json), for example if you are deploying the web demo in a diferent port than 3000.
```javascript
"homepage": "http://localhost:3000/"
```
- If you experience problems while building the demo, you may try the following steps:
1. Uninstall some dependencies:
- `npm uninstall -D prettier`
- `npm uninstall -D eslint-plugin-prettier`
- `npm uninstall -D eslint-config-prettier`
2. Remove node packages folder:
- `rm -fr node_modules`
3. Retry to deploy the demo web service from the beginning.
......@@ -48,7 +48,7 @@ import javax.ws.rs.core.UriInfo;
),
servers = {
@Server(
url = "http://localhost:8080/api"
url = "http://localhost:8080/api" // CHANGE API BASE URL
)
},
tags = {
......
#Generated by Maven
#Wed Nov 21 17:17:32 CET 2018
#Thu Nov 22 09:55:32 CET 2018
version=1.0
groupId=brunolopez
artifactId=expliclas-api
{
"name": "expliclas",
"homepage": "http://demos.citius.usc.es/ExpliClas",
"homepage": "http://localhost:3000/",
"version": "0.1.0",
"private": true,
"dependencies": {
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="wekaparser" default="default" basedir=".">
<description>Builds, tests, and runs the project wekaparser.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar: JAR building
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="wekaparser-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>
libs.CopyLibs.classpath=\
${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
libs.CopyLibs.displayName=CopyLibs Task
libs.CopyLibs.prop-version=2.0
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
This diff is collapsed.
build.xml.data.CRC32=9f9f13d5
build.xml.script.CRC32=118f4913
build.xml.stylesheet.CRC32=8064a381@1.80.1.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=9f9f13d5
nbproject/build-impl.xml.script.CRC32=68da8c73
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=wekaparser
application.vendor=brilemau
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# Files in build.classes.dir which should be excluded from distribution jar
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/wekaparser.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.cycles.jar=lib/cycles.jar
file.reference.jaxb-api-2.2.jar=lib/jaxb-api-2.2.jar
file.reference.SimpleNLG-4.4.9-SNAPSHOT.jar=lib/SimpleNLG-4.4.9-SNAPSHOT.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.SimpleNLG-4.4.9-SNAPSHOT.jar}:\
${file.reference.jaxb-api-2.2.jar}:\
${file.reference.cycles.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=true
javac.processorpath=\
${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=wekaparser.v2.WekaParserV2
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project.
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>wekaparser</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
<libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1">
<definitions>.\lib\nblibraries.properties</definitions>
</libraries>
</configuration>
</project>
=== Run information ===
Scheme: weka.classifiers.trees.J48 -U -M 2
Relation: BEER3
Instances: 400
Attributes: 4
Color
Bitterness
Strength
Beer Style
Test mode: 10-fold cross-validation
=== Classifier model (full training set) ===
J48 unpruned tree
------------------
Strength <= 0.07
| Color <= 17
| | Color <= 6
| | | Bitterness <= 26: 1.0 (50.0)
| | | Bitterness > 26: 3.0 (49.0)
| | Color > 6
| | | Strength <= 0.057: 2.0 (50.0/1.0)
| | | Strength > 0.057: 4.0 (2.0)
| Color > 17
| | Color <= 29: 7.0 (50.0/1.0)
| | Color > 29: 5.0 (51.0/1.0)
Strength > 0.07
| Bitterness <= 48: 8.0 (50.0)
| Bitterness > 48
| | Strength <= 0.091: 4.0 (48.0/3.0)
| | Strength > 0.091
| | | Color <= 11
| | | | Color <= 8: 4.0 (2.0)
| | | | Color > 8: 6.0 (5.0/1.0)
| | | Color > 11: 6.0 (43.0)
Number of Leaves : 11
Size of the tree : 21
Time taken to build model: 0.05 seconds
=== Stratified cross-validation ===
=== Summary ===
Correctly Classified Instances 379 94.75 %
Incorrectly Classified Instances 21 5.25 %
Kappa statistic 0.94
Mean absolute error 0.0163
Root mean squared error 0.1104
Relative absolute error 7.435 %
Root relative squared error 33.3842 %
Total Number of Instances 400
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class
1,000 0,000 1,000 1,000 1,000 1,000 1,000 1,000 1.0
0,980 0,006 0,961 0,980 0,970 0,966 0,986 0,947 2.0
0,960 0,003 0,980 0,960 0,970 0,965 0,976 0,945 3.0
0,860 0,023 0,843 0,860 0,851 0,830 0,958 0,718 4.0
0,980 0,003 0,980 0,980 0,980 0,977 0,987 0,947 5.0
0,840 0,017 0,875 0,840 0,857 0,837 0,926 0,825 6.0
0,980 0,003 0,980 0,980 0,980 0,977 0,986 0,942 7.0
0,980 0,006 0,961 0,980 0,970 0,966 0,987 0,937 8.0
Weighted Avg. 0,948 0,007 0,947 0,948 0,947 0,940 0,976 0,908
=== Confusion Matrix ===
a b c d e f g h <-- classified as
50 0 0 0 0 0 0 0 | a = 1.0
0 49 0 0 0 0 1 0 | b = 2.0
0 1 48 1 0 0 0 0 | c = 3.0
0 1 1 43 0 5 0 0 | d = 4.0
0 0 0 0 49 0 0 1 | e = 5.0
0 0 0 7 0 42 0 1 | f = 6.0
0 0 0 0 1 0 49 0 | g = 7.0
0 0 0 0 0 1 0 49 | h = 8.0
<?xml version="1.0" encoding="UTF-8"?>
<problem>
<attributes>
<attribute name="Color">
<valuetxt>Color</valuetxt>
<maxValue>45</maxValue>
<minValue>0</minValue>
<properties>
<property>
<valueTxt>Pale</valueTxt>
<interval>
<leftValue>0</leftValue>
<rightValue>3</rightValue>
</interval>
</property>
<property>
<valueTxt>Straw</valueTxt>
<interval>
<leftValue>3</leftValue>
<rightValue>7.5</rightValue>
</interval>
</property>
<property>
<valueTxt>Amber</valueTxt>
<interval>
<leftValue>7.5</leftValue>
<rightValue>19</rightValue>
</interval>
</property>
<property>
<valueTxt>Brown</valueTxt>
<interval>
<leftValue>19</leftValue>
<rightValue>29</rightValue>
</interval>
</property>
<property>
<valueTxt>Black</valueTxt>
<interval>
<leftValue>29</leftValue>
<rightValue>45</rightValue>
</interval>
</property>
</properties>
</attribute>
<attribute name="Bitterness">
<valuetxt>Bitterness</valuetxt>
<maxValue>250</maxValue>
<minValue>7</minValue>
<properties>
<property>
<valueTxt>Low</valueTxt>
<interval>
<leftValue>7</leftValue>
<rightValue>21</rightValue>
</interval>
</property>
<property>
<valueTxt>Low-Medium</valueTxt>
<interval>
<leftValue>21</leftValue>
<rightValue>32.5</rightValue>
</interval>
</property>
<property>
<valueTxt>Medium-High</valueTxt>
<interval>
<leftValue>32.5</leftValue>
<rightValue>47.5</rightValue>
</interval>
</property>
<property>
<valueTxt>High</valueTxt>
<interval>
<leftValue>47.5</leftValue>
<rightValue>250</rightValue>
</interval>
</property>
</properties>
</attribute>
<attribute name="Strength">
<valuetxt>Strength</valuetxt>
<maxValue>0.136</maxValue>
<minValue>0.035</minValue>
<properties>
<property>
<valueTxt>Session</valueTxt>
<interval>
<leftValue>0.035</leftValue>
<rightValue>0.0525</rightValue>
</interval>
</property>
<property>
<valueTxt>Standard</valueTxt>
<interval>
<leftValue>0.0525</leftValue>
<rightValue>0.0675</rightValue>
</interval>
</property>
<property>
<valueTxt>High</valueTxt>
<interval>
<leftValue>0.0675</leftValue>
<rightValue>0.09</rightValue>
</interval>
</property>
<property>
<valueTxt>Very high</valueTxt>
<interval>
<leftValue>0.09</leftValue>
<rightValue>0.136</rightValue>
</interval>
</property>
</properties>
</attribute>
</attributes>
<consequents>
<consequent>
<code>1</code>
<name>1.0</name>
<text>Blanche</text>
</consequent>
<consequent>
<code>2</code>
<name>2.0</name>
<text>Lager</text>
</consequent>
<consequent>
<code>3</code>
<name>3.0</name>
<text>Pilsner</text>
</consequent>
<consequent>
<code>4</code>
<name>4.0</name>
<text>IPA</text>
</consequent>
<consequent>
<code>5</code>
<name>5.0</name>
<text>Stout</text>
</consequent>
<consequent>
<code>6</code>
<name>6.0</name>
<text>Barleywine</text>
</consequent>
<consequent>
<code>7</code>
<name>7.0</name>
<text>Porter</text>
</consequent>
<consequent>
<code>8</code>
<name>8.0</name>
<text>Belgian Strong Ale</text>
</consequent>
</consequents>
</problem>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<config>
<propertiesAlt>
<property>
<valueTxt>unlikely</valueTxt>
<interval>
<leftValue>0</leftValue>
<rightValue>25</rightValue>
</interval>
</property>
<property>
<valueTxt>quite likely</valueTxt>
<interval>
<leftValue>25</leftValue>
<rightValue>75</rightValue>
</interval>
</property>
<property>
<valueTxt>just as likely</valueTxt>
<interval>
<leftValue>75</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesAlt>
<propertiesTree>
<property>
<valueTxt>an exception</valueTxt>
<interval>
<leftValue>-1</leftValue>
<rightValue>10</rightValue>
</interval>
</property>
<property>
<valueTxt>likely</valueTxt>
<interval>
<leftValue>10</leftValue>
<rightValue>30</rightValue>
</interval>
</property>
<property>
<valueTxt>very likely</valueTxt>
<interval>
<leftValue>30</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesTree>
<propertiesGlob>
<property>
<valueTxt>very confusing</valueTxt>
<interval>
<leftValue>0</leftValue>
<rightValue>30</rightValue>
</interval>
</property>
<property>
<valueTxt>quite confusing</valueTxt>
<interval>
<leftValue>30</leftValue>
<rightValue>89</rightValue>
</interval>
</property>
<property>
<valueTxt>very reliable</valueTxt>
<interval>
<leftValue>89</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesGlob>
<propertiesGlobConf>
<property>
<valueTxt>eventually</valueTxt>
<interval>
<leftValue>10</leftValue>
<rightValue>50</rightValue>
</interval>
</property>
<property>
<valueTxt>often</valueTxt>
<interval>
<leftValue>50</leftValue>
<rightValue>80</rightValue>
</interval>
</property>
<property>
<valueTxt>usually</valueTxt>
<interval>
<leftValue>80</leftValue>
<rightValue>100</rightValue>
</interval>
</property>
</propertiesGlobConf>
</config>
<?xml version="1.0"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:element name="propertiesAlt">
<xs:complexType>
<xs:sequence>