├── .gitignore
├── palmetto
├── src
│ ├── main
│ │ ├── resources
│ │ │ ├── cc
│ │ │ │ └── mallet
│ │ │ │ │ └── util
│ │ │ │ │ └── resources
│ │ │ │ │ └── logging.properties
│ │ │ ├── log4j.properties
│ │ │ └── license_template.txt
│ │ └── java
│ │ │ └── org
│ │ │ └── aksw
│ │ │ └── palmetto
│ │ │ ├── io
│ │ │ ├── DocumentTextSupplier.java
│ │ │ ├── SimpleDocumentTextSupplier.java
│ │ │ ├── GoldStandardReader.java
│ │ │ └── SimpleWordSetReader.java
│ │ │ ├── evaluate
│ │ │ └── correlation
│ │ │ │ └── RankCorrelationCalculator.java
│ │ │ ├── prob
│ │ │ ├── bd
│ │ │ │ └── BooleanDocumentFrequencyDeterminer.java
│ │ │ ├── decorator
│ │ │ │ ├── SlidingWindowFrequencyDeterminerDecorator.java
│ │ │ │ ├── FrequencyDeterminerDecorator.java
│ │ │ │ ├── AbstractFrequencyDeterminerDecorator.java
│ │ │ │ ├── AbstractSlidingWindowFrequencyDeterminerDecorator.java
│ │ │ │ └── SimpleFrequencyCachingDeterminerDecorator.java
│ │ │ ├── window
│ │ │ │ ├── WindowBasedFrequencyDeterminer.java
│ │ │ │ └── WindowBasedProbabilityEstimator.java
│ │ │ ├── FrequencyDeterminer.java
│ │ │ ├── AbstractProbabilitySupplier.java
│ │ │ └── ProbabilityEstimator.java
│ │ │ ├── corpus
│ │ │ ├── CorpusAdapter.java
│ │ │ ├── lucene
│ │ │ │ ├── SlidingWindowCounter.java
│ │ │ │ ├── creation
│ │ │ │ │ └── IndexableDocument.java
│ │ │ │ └── SimpleAnalyzer.java
│ │ │ └── WindowSupportingAdapter.java
│ │ │ ├── calculations
│ │ │ ├── indirect
│ │ │ │ ├── VectorBasedConfirmationMeasure.java
│ │ │ │ ├── CosinusConfirmationMeasure.java
│ │ │ │ ├── DiceConfirmationMeasure.java
│ │ │ │ ├── JaccardConfirmationMeasure.java
│ │ │ │ └── CentroidConfirmationMeasure.java
│ │ │ ├── ConfirmationMeasure.java
│ │ │ └── direct
│ │ │ │ ├── LogBasedCalculation.java
│ │ │ │ ├── DirectConfirmationMeasure.java
│ │ │ │ ├── JointProbabilityConfirmationMeasure.java
│ │ │ │ ├── AbstractUndefinedResultHandlingConfirmationMeasure.java
│ │ │ │ ├── DifferenceBasedConfirmationMeasure.java
│ │ │ │ ├── JaccardConfirmationMeasure.java
│ │ │ │ └── LogJaccardConfirmationMeasure.java
│ │ │ ├── weight
│ │ │ ├── Weighter.java
│ │ │ ├── EqualWeighter.java
│ │ │ ├── ConditionalProbabilityBasedWeighter.java
│ │ │ ├── MarginalProbabilityBasedWeighter.java
│ │ │ ├── CompleteProbabilityBasedWeighter.java
│ │ │ └── WordSetSizeBasedWeighter.java
│ │ │ ├── subsets
│ │ │ ├── Segmentator.java
│ │ │ ├── SetSet.java
│ │ │ ├── OneAll.java
│ │ │ ├── OneSet.java
│ │ │ ├── AllAll.java
│ │ │ ├── AllOne.java
│ │ │ ├── OnePreceding.java
│ │ │ ├── OneSucceeding.java
│ │ │ ├── OneOne.java
│ │ │ └── OneOneAndSelf.java
│ │ │ ├── data
│ │ │ ├── SubsetVectors.java
│ │ │ └── SubsetProbabilities.java
│ │ │ ├── Coherence.java
│ │ │ ├── aggregation
│ │ │ ├── ArithmeticMean.java
│ │ │ ├── Min.java
│ │ │ ├── Max.java
│ │ │ ├── QuadraticMean.java
│ │ │ ├── Aggregation.java
│ │ │ ├── GeometricMean.java
│ │ │ ├── HarmonicMean.java
│ │ │ └── Median.java
│ │ │ └── vector
│ │ │ ├── VectorCreator.java
│ │ │ ├── AbstractVectorCreator.java
│ │ │ └── ProbabilityBasedVectorCreator.java
│ └── test
│ │ └── java
│ │ └── org
│ │ └── aksw
│ │ └── palmetto
│ │ ├── subsets
│ │ ├── AllAllTest.java
│ │ ├── OneAllTest.java
│ │ ├── AllOneTest.java
│ │ ├── OneOneTest.java
│ │ ├── OneSetTest.java
│ │ ├── OneOneAndSelfTest.java
│ │ ├── OnePrecedingTest.java
│ │ ├── OneSubsequentTest.java
│ │ └── OneAnyTest.java
│ │ ├── sum
│ │ ├── MaxTest.java
│ │ ├── MinTest.java
│ │ ├── MedianTest.java
│ │ ├── HarmonicMeanTest.java
│ │ ├── ArithmeticMeanTest.java
│ │ ├── GeometricMeanTest.java
│ │ ├── AbstractSummarizationTest.java
│ │ └── QuadraticMeanTest.java
│ │ ├── calculations
│ │ ├── indirect
│ │ │ ├── AbstractVectorBasedCalculationTest.java
│ │ │ ├── AbstractVectorBasedCoherenceTest.java
│ │ │ └── VectorCreationTest.java
│ │ └── direct
│ │ │ ├── AbstractProbabilityBasedCalculationTest.java
│ │ │ └── OlssonsCoherenceCalculationTest.java
│ │ ├── vector
│ │ └── AbstractProbCalcBasedVectorCreatorTest.java
│ │ ├── evaluate
│ │ ├── correlation
│ │ │ ├── KendallsTauTest.java
│ │ │ └── SpearmanTest.java
│ │ └── rank
│ │ │ └── RankerTest.java
│ │ └── prob
│ │ └── AbstractBooleanDocumentSupportingAdapterBasedTest.java
└── README.md
├── webApp
├── src
│ ├── main
│ │ ├── webapp
│ │ │ ├── images
│ │ │ │ ├── esf.jpg
│ │ │ │ ├── dice_logo.jpg
│ │ │ │ ├── logo-aksw.png
│ │ │ │ ├── flag_of_Europe.jpg
│ │ │ │ └── palmetto_64px.png
│ │ │ ├── css
│ │ │ │ ├── images
│ │ │ │ │ ├── ui-icons_222222_256x240.png
│ │ │ │ │ ├── ui-icons_2e83ff_256x240.png
│ │ │ │ │ ├── ui-icons_454545_256x240.png
│ │ │ │ │ ├── ui-icons_888888_256x240.png
│ │ │ │ │ ├── ui-icons_cd0a0a_256x240.png
│ │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png
│ │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_55_fbf9ee_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_65_ffffff_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_75_dadada_1x100.png
│ │ │ │ │ ├── ui-bg_highlight-soft_75_e6e6e6_1x100.png
│ │ │ │ │ └── ui-bg_highlight-soft_95_fef1ec_1x100.png
│ │ │ │ └── palmetto.css
│ │ │ └── WEB-INF
│ │ │ │ └── web.xml
│ │ ├── resources
│ │ │ └── palmetto.properties
│ │ └── java
│ │ │ └── org
│ │ │ └── aksw
│ │ │ └── palmetto
│ │ │ └── webapp
│ │ │ └── config
│ │ │ └── PalmettoConfiguration.java
│ └── test
│ │ └── java
│ │ └── org
│ │ └── aksw
│ │ └── palmetto
│ │ └── webapp
│ │ └── PerformanceTest.java
├── Dockerfile
├── README.md
├── Makefile
└── tomcat-users.xml
├── Makefile
├── .travis.yml
├── .editorconfig
└── .github
└── workflows
└── maven.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | .classpath
3 | .project
4 | target
5 | .settings
6 | # Package Files #
7 | *.war
8 | *.ear
9 |
--------------------------------------------------------------------------------
/palmetto/src/main/resources/cc/mallet/util/resources/logging.properties:
--------------------------------------------------------------------------------
1 | handlers= org.slf4j.bridge.SLF4JBridgeHandler
2 |
--------------------------------------------------------------------------------
/webApp/src/main/webapp/images/esf.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/images/esf.jpg
--------------------------------------------------------------------------------
/webApp/src/main/webapp/images/dice_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/images/dice_logo.jpg
--------------------------------------------------------------------------------
/webApp/src/main/webapp/images/logo-aksw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/images/logo-aksw.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/images/flag_of_Europe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/images/flag_of_Europe.jpg
--------------------------------------------------------------------------------
/webApp/src/main/webapp/images/palmetto_64px.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/images/palmetto_64px.png
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | default: build
2 |
3 | build:
4 | cd palmetto && mvn clean install
5 | cd webApp && make build
6 |
7 | dockerize:
8 | cd webApp && make dockerize
9 |
10 |
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-icons_222222_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-icons_222222_256x240.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-icons_454545_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-icons_454545_256x240.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-icons_888888_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-icons_888888_256x240.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-icons_cd0a0a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-icons_cd0a0a_256x240.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_flat_0_aaaaaa_40x100.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_flat_75_ffffff_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_flat_75_ffffff_40x100.png
--------------------------------------------------------------------------------
/webApp/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM tomcat:9.0.65-jre8
2 |
3 | VOLUME /usr/src/indexes/
4 |
5 | RUN rm -rf /usr/local/tomcat/webapps/*
6 | COPY target/palmetto-webapp.war /usr/local/tomcat/webapps/ROOT.war
7 |
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_55_fbf9ee_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_55_fbf9ee_1x100.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_65_ffffff_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_65_ffffff_1x100.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_75_dadada_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_75_dadada_1x100.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_75_e6e6e6_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_75_e6e6e6_1x100.png
--------------------------------------------------------------------------------
/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_95_fef1ec_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dice-group/Palmetto/HEAD/webApp/src/main/webapp/css/images/ui-bg_highlight-soft_95_fef1ec_1x100.png
--------------------------------------------------------------------------------
/palmetto/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | # Direct log messages to stdout
2 | log4j.rootLogger=WARN,stdout
3 |
4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
6 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
7 |
8 | log4j.category.org.aksw.palmetto=INFO
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | before_install:
4 | - cd palmetto
5 | - sudo apt-get install jq
6 | - sudo apt-get install snapd
7 | - sudo snap install jq
8 | - wget -O ~/codacy-coverage-reporter-assembly-latest.jar "https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.5/codacy-coverage-reporter-4.0.5-assembly.jar"
9 |
10 | after_success:
11 | - mvn jacoco:report
12 | - java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml
13 |
--------------------------------------------------------------------------------
/webApp/src/main/resources/palmetto.properties:
--------------------------------------------------------------------------------
1 | # The path to the Lucene index containing the wikipedia
2 | org.aksw.palmetto.webapp.resources.AbstractCoherenceResource.indexPath=../indexes/wikipedia_bd
3 | # Number of words a topic can have
4 | org.aksw.palmetto.webapp.resources.AbstractCoherenceResource.maxWords=10
5 | # Maximum size of the lucene cache
6 | org.aksw.palmetto.corpus.lucene.CachingWindowSupportingLuceneCorpusAdapter.maxCacheSize=100
7 | # The window sizes of the different coherences
8 | org.aksw.palmetto.webapp.resources.CAResource.windowSize=5
9 | org.aksw.palmetto.webapp.resources.CPResource.windowSize=70
10 | org.aksw.palmetto.webapp.resources.CVResource.windowSize=110
11 | org.aksw.palmetto.webapp.resources.NPMIResource.windowSize=10
12 | org.aksw.palmetto.webapp.resources.UCIResource.windowSize=10
13 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig: http://EditorConfig.org
2 | # top-most EditorConfig file
3 | root = true
4 |
5 | # all files defaults
6 | [*]
7 | # Unix-style newlines with a newline ending
8 | end_of_line = lf
9 | insert_final_newline = true
10 | # Set default charset
11 | charset = utf-8
12 | # 4 space indentation
13 | indent_style = space
14 | indent_size = 4
15 | # trim whitespaces
16 | trim_trailing_whitespace = true
17 | # always insert final newline
18 | insert_final_newline = true
19 |
20 | [*.md]
21 | trim_trailing_whitespace = false
22 |
23 | # tab for makefiles
24 | [{Makefile, Makefile*, *.xml}]
25 | indent_style = tab
26 | indent_size = 4
27 |
28 | # 2 spaces for Dockerfiles
29 | [{Dockerfile, Dockerfile*}]
30 | indent_style = space
31 | indent_size = 2
32 |
33 | # 2 spaces for md, yaml, ttl, etc..
34 | [*.{md,yml,iml,json,ttl,ts,js,html,css}]
35 | indent_style = space
36 | indent_size = 2
37 |
--------------------------------------------------------------------------------
/webApp/README.md:
--------------------------------------------------------------------------------
1 | Palmetto
2 | ========
3 | Palmetto is a quality measuring tool for topics
4 |
5 | This is the implementation of a simple web service wrapping Palmetto.
6 |
7 | Palmetto from DICE is licensed under a AGPL v3.0 License.
8 |
9 | ### Docker
10 |
11 | Palmetto can be used as a docker container. The container can be build and run from the `webApp` directory.
12 |
13 | ```
14 | docker build -t palmetto .
15 | docker run -p 7777:8080 -d -m 4G palmetto`
16 | ```
17 |
18 | After that there is a Tomcat listening on port 7777. The demo application can be accessed using `http://localhost:7777`.
19 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/io/DocumentTextSupplier.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.io;
19 |
20 | @Deprecated
21 | public interface DocumentTextSupplier {
22 |
23 | public String getNextDocumentText();
24 | }
25 |
--------------------------------------------------------------------------------
/webApp/Makefile:
--------------------------------------------------------------------------------
1 | default: build
2 |
3 | build:
4 | mvn clean package
5 |
6 | Major=0
7 | Minor=1
8 | Patch=5
9 |
10 | dockerize:
11 | docker build -t dicegroup/palmetto-service:latest .
12 | docker tag dicegroup/palmetto-service:latest dicegroup/palmetto-service:$(Major)
13 | docker tag dicegroup/palmetto-service:latest dicegroup/palmetto-service:$(Major).$(Minor)
14 | docker tag dicegroup/palmetto-service:latest dicegroup/palmetto-service:$(Major).$(Minor).$(Patch)
15 |
16 | push:
17 | docker push dicegroup/palmetto-service:latest
18 | docker push dicegroup/palmetto-service:$(Major)
19 | docker push dicegroup/palmetto-service:$(Major).$(Minor)
20 | docker push dicegroup/palmetto-service:$(Major).$(Minor).$(Patch)
21 |
22 | dockerize-with-index:
23 | docker build -t dicegroup/palmetto-service:en-wiki -f Dockerfile.en-wiki .
24 | docker tag dicegroup/palmetto-service:en-wiki dicegroup/palmetto-service:$(Major)-en-wiki
25 | docker tag dicegroup/palmetto-service:en-wiki dicegroup/palmetto-service:$(Major).$(Minor)-en-wiki
26 | docker tag dicegroup/palmetto-service:en-wiki dicegroup/palmetto-service:$(Major).$(Minor).$(Patch)-en-wiki
27 |
28 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/evaluate/correlation/RankCorrelationCalculator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.evaluate.correlation;
19 |
20 | public interface RankCorrelationCalculator {
21 |
22 | public double calculateRankCorrelation(final double x[], final double y[]);
23 | }
24 |
--------------------------------------------------------------------------------
/palmetto/src/main/resources/license_template.txt:
--------------------------------------------------------------------------------
1 | Copyright (C) ${year} ${owner} (${email})
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/palmetto/README.md:
--------------------------------------------------------------------------------
1 | Palmetto
2 | ========
3 | Palmetto is a quality measuring tool for topics
4 |
5 | This is the implementation of coherence calculations for evaluating the quality of topics. If you want to learn more about coherence calculations and their meaning for topic evaluation, take a look at the project homepage - especially at the publications.
6 |
7 | Palmetto from DICE is licensed under a AGPL v3.0 License.
8 |
9 | Please take a look at the the wikipage to read how Palmetto can be used.
10 |
11 | If you are using Palmetto for an experiment or something similar that leads to a publication, please cite the paper "Exploring the Space of Topic Coherence Measures" that you can find on the project website. A link to the project website is welcome as well :)
12 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/prob/bd/BooleanDocumentFrequencyDeterminer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.prob.bd;
19 |
20 | import org.aksw.palmetto.prob.FrequencyDeterminer;
21 |
22 |
23 | public interface BooleanDocumentFrequencyDeterminer extends FrequencyDeterminer {
24 |
25 | public int getNumberOfDocuments();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/corpus/CorpusAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.corpus;
19 |
20 | /**
21 | * This is the interface for a corpus adapter - a component that makes word counts available to the system.
22 | *
23 | * @author m.roeder
24 | *
25 | */
26 | public interface CorpusAdapter {
27 |
28 | public void close();
29 | }
30 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/prob/decorator/SlidingWindowFrequencyDeterminerDecorator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.prob.decorator;
19 |
20 | import org.aksw.palmetto.prob.window.WindowBasedFrequencyDeterminer;
21 |
22 | public interface SlidingWindowFrequencyDeterminerDecorator extends FrequencyDeterminerDecorator,
23 | WindowBasedFrequencyDeterminer {
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/prob/decorator/FrequencyDeterminerDecorator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.prob.decorator;
19 |
20 | import org.aksw.palmetto.prob.FrequencyDeterminer;
21 |
22 | public interface FrequencyDeterminerDecorator extends FrequencyDeterminer {
23 |
24 | public FrequencyDeterminer getDeterminer();
25 |
26 | public void setDeterminer(FrequencyDeterminer determiner);
27 | }
28 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/calculations/indirect/VectorBasedConfirmationMeasure.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.calculations.indirect;
19 |
20 | import org.aksw.palmetto.calculations.ConfirmationMeasure;
21 | import org.aksw.palmetto.data.SubsetVectors;
22 |
23 | public interface VectorBasedConfirmationMeasure extends ConfirmationMeasure {
24 |
25 | public abstract double[] calculateConfirmationValues(SubsetVectors subsetVectors);
26 | }
27 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/calculations/ConfirmationMeasure.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.calculations;
19 |
20 | /**
21 | * The general interface of a confirmation measure.
22 | *
23 | * @author Michael Röder
24 | *
25 | */
26 | public interface ConfirmationMeasure {
27 |
28 | /**
29 | * Returns the name of the measure.
30 | *
31 | * @return the name of the measure.
32 | */
33 | public String getName();
34 | }
35 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/calculations/direct/LogBasedCalculation.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.calculations.direct;
19 |
20 | /**
21 | * This interface defines the epsilon used by log based calculations for
22 | * avoiding the logarithm of 0.
23 | *
24 | * @author Michael Röder
25 | *
26 | */
27 | public interface LogBasedCalculation {
28 |
29 | /**
30 | * e={@value}
31 | */
32 | public static final double EPSILON = 1.0E-12;
33 | }
34 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/prob/window/WindowBasedFrequencyDeterminer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.prob.window;
19 |
20 | import org.aksw.palmetto.prob.FrequencyDeterminer;
21 |
22 | public interface WindowBasedFrequencyDeterminer extends FrequencyDeterminer {
23 |
24 | public void setWindowSize(int windowSize);
25 |
26 | public long[] getCooccurrenceCounts();
27 |
28 | public String getSlidingWindowModelName();
29 |
30 | public int getWindowSize();
31 | }
32 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/AllAllTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | @Deprecated
23 | public class AllAllTest extends AbstractSegmentatorTest {
24 |
25 | @Test
26 | public void testWordSetLength4() {
27 | int expectedSegments[] = new int[] { 15 };
28 | int expectedConditions[][] = new int[][] { { 15 } };
29 | testSubsetCreator(4, new AllAll(), expectedSegments, expectedConditions);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/weight/Weighter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.weight;
19 |
20 | import org.aksw.palmetto.data.SubsetProbabilities;
21 |
22 | /**
23 | * This is an interface for a class that can be used to weight the single elements of a segmentation scheme.
24 | *
25 | * @author m.roeder
26 | *
27 | */
28 | @Deprecated
29 | public interface Weighter {
30 |
31 | public double[] createWeights(SubsetProbabilities probabilities);
32 |
33 | public String getName();
34 | }
35 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/OneAllTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class OneAllTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 1, 2, 4, 8 };
27 | int expectedConditions[][] = new int[][] { { 14 }, { 13 }, { 11 },
28 | { 7 } };
29 |
30 | testSubsetCreator(4, new OneAll(), expectedSegments, expectedConditions);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/AllOneTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class AllOneTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 14, 13, 11, 7 };
27 | int expectedConditions[][] = new int[][] { { 1 }, { 2 }, { 4 }, { 8 } };
28 | testSubsetCreator(4, new AllOne(), expectedSegments, expectedConditions);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/subsets/Segmentator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.aksw.palmetto.data.SegmentationDefinition;
21 |
22 | /**
23 | * A {@link Segmentator} generates the {@link SegmentationDefinition} object for a
24 | * word set with the given size.
25 | *
26 | * @author Michael Röder
27 | *
28 | */
29 | public interface Segmentator {
30 |
31 | public SegmentationDefinition getSubsetDefinition(int wordsetSize);
32 |
33 | public String getName();
34 | }
35 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/OneOneTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class OneOneTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 1, 2, 4, 8 };
27 | int expectedConditions[][] = new int[][] { { 2, 4, 8 }, { 1, 4, 8 },
28 | { 1, 2, 8 }, { 1, 2, 4 } };
29 |
30 | testSubsetCreator(4, new OneOne(), expectedSegments, expectedConditions);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/OneSetTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class OneSetTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 1, 2, 4, 8 };
27 | int expectedConditions[][] = new int[][] { { 15 }, { 15 }, { 15 },
28 | { 15 } };
29 |
30 | testSubsetCreator(4, new OneSet(), expectedSegments, expectedConditions);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/OneOneAndSelfTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class OneOneAndSelfTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 1, 2, 4, 8 };
27 | int expectedConditions[][] = new int[][] { { 1, 2, 4, 8 }, { 1, 2, 4, 8 }, { 1, 2, 4, 8 }, { 1, 2, 4, 8 } };
28 |
29 | testSubsetCreator(4, new OneOneAndSelf(), expectedSegments, expectedConditions);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/OnePrecedingTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class OnePrecedingTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 1, 2, 4, 8 };
27 | int expectedConditions[][] = new int[][] { {}, { 1 }, { 1, 2 },
28 | { 1, 2, 4 } };
29 |
30 | testSubsetCreator(4, new OnePreceding(), expectedSegments,
31 | expectedConditions);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/subsets/OneSubsequentTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.subsets;
19 |
20 | import org.junit.Test;
21 |
22 | public class OneSubsequentTest extends AbstractSegmentatorTest {
23 |
24 | @Test
25 | public void testWordSetLength4() {
26 | int expectedSegments[] = new int[] { 1, 2, 4, 8 };
27 | int expectedConditions[][] = new int[][] { { 2, 4, 8 }, { 4, 8 }, { 8 },
28 | {} };
29 |
30 | testSubsetCreator(4, new OneSucceeding(), expectedSegments,
31 | expectedConditions);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/data/SubsetVectors.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.data;
19 |
20 | /**
21 | * This class contains the segmentations, probabilities and context vectors for a word set.
22 | *
23 | * @author m.roeder
24 | *
25 | */
26 | public class SubsetVectors extends SubsetProbabilities {
27 |
28 | public double vectors[][];
29 |
30 | public SubsetVectors(int[] segments, int[][] conditions, double[][] vectors, double[] segmentProbabilities) {
31 | super(segments, conditions, segmentProbabilities);
32 | this.vectors = vectors;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/webApp/tomcat-users.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
21 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/prob/FrequencyDeterminer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.prob;
19 |
20 | import org.aksw.palmetto.data.CountedSubsets;
21 | import org.aksw.palmetto.data.SegmentationDefinition;
22 |
23 | /**
24 | * Determines the frequencies of words and word sub sets of a given word set.
25 | *
26 | * @author m.roeder
27 | *
28 | */
29 | public interface FrequencyDeterminer {
30 |
31 | /**
32 | * Returns the frequencies of words and word sub sets of the given word sets.
33 | *
34 | * @param wordsets
35 | * @param definitions
36 | * @return
37 | */
38 | public CountedSubsets[] determineCounts(String wordsets[][],
39 | SegmentationDefinition definitions[]);
40 | }
41 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/weight/EqualWeighter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.weight;
19 |
20 | import java.util.Arrays;
21 |
22 | import org.aksw.palmetto.data.SubsetProbabilities;
23 |
24 | @Deprecated
25 | public class EqualWeighter implements Weighter {
26 |
27 | @Override
28 | public double[] createWeights(SubsetProbabilities probabilities) {
29 | int pos = 0;
30 | for (int i = 0; i < probabilities.segments.length; ++i) {
31 | pos += probabilities.conditions[i].length;
32 | }
33 | double weights[] = new double[pos];
34 | Arrays.fill(weights, 1.0);
35 | return weights;
36 | }
37 |
38 | @Override
39 | public String getName() {
40 | return "E_e";
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/prob/decorator/AbstractFrequencyDeterminerDecorator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.prob.decorator;
19 |
20 | import org.aksw.palmetto.prob.FrequencyDeterminer;
21 |
22 | public abstract class AbstractFrequencyDeterminerDecorator implements FrequencyDeterminerDecorator {
23 |
24 | protected FrequencyDeterminer determiner;
25 |
26 | public AbstractFrequencyDeterminerDecorator(FrequencyDeterminer determiner) {
27 | this.determiner = determiner;
28 | }
29 |
30 | @Override
31 | public FrequencyDeterminer getDeterminer() {
32 | return determiner;
33 | }
34 |
35 | @Override
36 | public void setDeterminer(FrequencyDeterminer determiner) {
37 | this.determiner = determiner;
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/corpus/lucene/SlidingWindowCounter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.corpus.lucene;
19 |
20 | import com.carrotsearch.hppc.IntArrayList;
21 |
22 | @Deprecated
23 | public interface SlidingWindowCounter {
24 |
25 | public void setWindowSize(int windowSize);
26 |
27 | public int determineCount(IntArrayList[] positions);
28 |
29 | /**
30 | * This method returns the sum of word sets which would be counted if one would go over the complete corpus using
31 | * the sliding window. Note that if the given word set length is 1 this method must return the sum of all
32 | * terms inside the corpus.
33 | *
34 | * @param wordSetLength
35 | * @return
36 | */
37 | public long getWordSetCountSum(int wordSetLength);
38 | }
39 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/Coherence.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto;
19 |
20 | /**
21 | * A coherence measure calculates the coherence of a given set of top word sets.
22 | *
23 | * @author Michael Röder
24 | *
25 | */
26 | public interface Coherence {
27 |
28 | /**
29 | * Calculates the coherence for the given set of top word sets.
30 | *
31 | * @param wordsets
32 | * set of topic top words
33 | * @return a double array containing the coherences for the given top word
34 | * sets.
35 | */
36 | public double[] calculateCoherences(String[][] wordsets);
37 |
38 | /**
39 | * Returns the name of the coherence.
40 | *
41 | * @return the name of the coherence
42 | */
43 | public String getName();
44 | }
45 |
--------------------------------------------------------------------------------
/palmetto/src/main/java/org/aksw/palmetto/calculations/direct/DirectConfirmationMeasure.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.calculations.direct;
19 |
20 | import org.aksw.palmetto.calculations.ConfirmationMeasure;
21 | import org.aksw.palmetto.data.SubsetProbabilities;
22 |
23 | /**
24 | * This interface is implemented by all confirmation measures which are using
25 | * the probabilities directly.
26 | *
27 | * @author Michael Röder
28 | *
29 | */
30 | public interface DirectConfirmationMeasure extends ConfirmationMeasure {
31 |
32 | /**
33 | * Calculates the confirmation values for the given subset probabilities.
34 | *
35 | * @param subsetProbabilities
36 | * subset probabilities used for the calculation
37 | * @return confirmation values
38 | */
39 | public abstract double[] calculateConfirmationValues(SubsetProbabilities subsetProbabilities);
40 | }
41 |
--------------------------------------------------------------------------------
/palmetto/src/test/java/org/aksw/palmetto/sum/MaxTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Palmetto - Palmetto is a quality measure tool for topics.
3 | * Copyright © 2014 Data Science Group (DICE) (michael.roeder@uni-paderborn.de)
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU Affero General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU Affero General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Affero General Public License
16 | * along with this program. If not, see .
17 | */
18 | package org.aksw.palmetto.sum;
19 |
20 | import java.util.Arrays;
21 | import java.util.Collection;
22 |
23 | import org.aksw.palmetto.aggregation.Max;
24 | import org.junit.runner.RunWith;
25 | import org.junit.runners.Parameterized;
26 | import org.junit.runners.Parameterized.Parameters;
27 |
28 | @RunWith(Parameterized.class)
29 | public class MaxTest extends AbstractSummarizationTest {
30 |
31 | @Parameters
32 | public static Collection