Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

Commit 46fb5c1

Browse files
committed
8.2.0: Merged PR with new Sentence-Simplification patterns, removed SentenceSimplification dependencies.
1 parent 6d9b6f7 commit 46fb5c1

File tree

16 files changed

+2029
-16261
lines changed

16 files changed

+2029
-16261
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cache:
55
directories:
66
- "$HOME/.m2"
77
before_install:
8-
- "./install-SentenceSimplification.sh"
8+
99
notifications:
1010
slack:
1111
on_success: always

DiscourseSimplification.iml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
</content>
1313
<orderEntry type="inheritedJdk" />
1414
<orderEntry type="sourceFolder" forTests="false" />
15-
<orderEntry type="library" name="Maven: org.lambda3.text.simplification:sentence-simplification:5.0.0" level="project" />
15+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
16+
<orderEntry type="library" name="Maven: com.typesafe:config:1.3.1" level="project" />
17+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.9" level="project" />
18+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.9" level="project" />
19+
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.9" level="project" />
1620
<orderEntry type="library" name="Maven: edu.stanford.nlp:stanford-corenlp:3.7.0" level="project" />
1721
<orderEntry type="library" name="Maven: com.apple:AppleJavaExtensions:1.4" level="project" />
1822
<orderEntry type="library" name="Maven: de.jollyday:jollyday:0.4.9" level="project" />
@@ -33,9 +37,9 @@
3337
<orderEntry type="library" name="Maven: org.glassfish:javax.json:1.0.4" level="project" />
3438
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.6.1" level="project" />
3539
<orderEntry type="library" name="Maven: edu.stanford.nlp:stanford-corenlp:models:3.7.0" level="project" />
40+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.12" level="project" />
3641
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.8" level="project" />
3742
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.8" level="project" />
38-
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
3943
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.0.0-M3" level="project" />
4044
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.0.0-M1" level="project" />
4145
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.0.0-M3" level="project" />

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@
33
# Discourse Simplification
44

55
A project for simplifying sentences wrt. discourse/rhetorical structures.
6-
This works as a wrapper for the [SentenceSimplification](https://github.com/Lambda-3/SentenceSimplification) project.
76

8-
## Dependencies
7+
This is the core component of the [Graphene](https://github.com/Lambda-3/Graphene) project.
98

10-
### SentenceSimplification
9+
## Setup
1110

12-
Clone and install locally
13-
14-
git clone --branch v5.0.0 https://github.com/Lambda-3/SentenceSimplification.git
15-
cd SentenceSimplification
16-
mvn install
17-
18-
## Building and Running
19-
20-
mvn package
11+
mvn clean install -DskipTests
2112

2213
### Run the program
2314
Create a new text file with the input

install-SentenceSimplification.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

log/out.log

Lines changed: 2002 additions & 15616 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<groupId>org.lambda3.text.simplification</groupId>
2828
<artifactId>discourse-simplification</artifactId>
29-
<version>8.1.1</version>
29+
<version>8.2.0</version>
3030
<packaging>jar</packaging>
3131

3232
<name>Discourse Simplification</name>
@@ -82,13 +82,6 @@
8282
<version>${jackson.version}</version>
8383
</dependency>
8484

85-
<!-- Sentence Simplification -->
86-
<dependency>
87-
<groupId>org.lambda3.text.simplification</groupId>
88-
<artifactId>sentence-simplification</artifactId>
89-
<version>${simplification.version}</version>
90-
</dependency>
91-
9285
<!-- Stanford NLP -->
9386
<dependency>
9487
<groupId>edu.stanford.nlp</groupId>
@@ -101,6 +94,12 @@
10194
</exclusion>
10295
</exclusions>
10396
</dependency>
97+
<dependency>
98+
<groupId>edu.stanford.nlp</groupId>
99+
<artifactId>stanford-corenlp</artifactId>
100+
<version>${corenlp.version}</version>
101+
<classifier>models</classifier>
102+
</dependency>
104103

105104
<!-- Logging -->
106105
<dependency>

src/main/java/org/lambda3/text/simplification/discourse/App.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ private static void saveLines(File file, List<String> lines) {
5151
}
5252

5353
public static void main(String[] args) throws IOException {
54-
5554
SimplificationContent content = DISCOURSE_SIMPLIFIER.doDiscourseSimplification(new File("input.txt"), ProcessingType.SEPARATE, true);
5655
content.serializeToJSON(new File("output.json"));
5756
saveLines(new File("output_default.txt"), Arrays.asList(content.defaultFormat(false)));

src/main/java/org/lambda3/text/simplification/discourse/processing/DiscourseSimplifier.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.lambda3.text.simplification.discourse.model.SimplificationContent;
3030
import org.lambda3.text.simplification.discourse.runner.discourse_extraction.DiscourseExtractor;
3131
import org.lambda3.text.simplification.discourse.runner.discourse_tree.DiscourseTreeCreator;
32-
import org.lambda3.text.simplification.discourse.runner.sentence_simplification.SentenceSimplifier;
3332
import org.lambda3.text.simplification.discourse.utils.ConfigUtils;
3433
import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeException;
3534
import org.lambda3.text.simplification.discourse.utils.sentences.SentencesUtils;
@@ -47,18 +46,13 @@
4746
public class DiscourseSimplifier {
4847
private final DiscourseTreeCreator discourseTreeCreator;
4948
private final DiscourseExtractor discourseExtractor;
50-
private final SentenceSimplifier sentenceSimplifier;
51-
private final boolean withSentenceSimplification;
5249

5350
private final Logger logger = LoggerFactory.getLogger(getClass());
5451

5552
public DiscourseSimplifier(Config config) {
5653
SentencePreprocessor preprocessor = new SentencePreprocessor(config);
5754
this.discourseTreeCreator = new DiscourseTreeCreator(config, preprocessor);
5855
this.discourseExtractor = new DiscourseExtractor(config);
59-
this.sentenceSimplifier = new SentenceSimplifier(config);
60-
61-
this.withSentenceSimplification = config.getBoolean("with-sentence-simplification");
6256

6357
logger.debug("DiscourseSimplifier initialized");
6458
logger.debug("\n{}", ConfigUtils.prettyPrint(config));
@@ -132,17 +126,6 @@ private SimplificationContent processWhole(List<String> sentences) {
132126
logger.debug(content.toString());
133127
}
134128

135-
// Step 3) do sentence simplification
136-
logger.info("### STEP 3) DO SENTENCE SIMPLIFICATION ###");
137-
if (withSentenceSimplification) {
138-
content.getSentences().forEach(s -> sentenceSimplifier.doSentenceSimplification(s));
139-
if (logger.isDebugEnabled()) {
140-
logger.debug(content.toString());
141-
}
142-
} else {
143-
logger.info("DEACTIVATED");
144-
}
145-
146129
logger.info("### FINISHED");
147130
return content;
148131
}
@@ -174,14 +157,6 @@ private SimplificationContent processSeparate(List<String> sentences) {
174157
elements.forEach(e -> outSentence.addElement(e));
175158
logger.debug(outSentence.toString());
176159

177-
// Step 3) do sentence simplification
178-
logger.debug("### STEP 3) DO SENTENCE SIMPLIFICATION ###");
179-
if (withSentenceSimplification) {
180-
sentenceSimplifier.doSentenceSimplification(outSentence);
181-
logger.debug(outSentence.toString());
182-
} else {
183-
logger.info("DEACTIVATED");
184-
}
185160
} catch (ParseTreeException e) {
186161
logger.error("Failed to process sentence: {}", sentence);
187162
}

src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/Relation.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ public enum Relation {
5757
TEMPORAL_TIME, // indicating a particular instance on a time scale (e.g. “Next Sunday 2 pm”).
5858
TEMPORAL_DURATION, // the amount of time between the two end-points of a time interval (e.g. “2 weeks").
5959
TEMPORAL_DATE, // particular date (e.g. “On 7 April 2013”).
60-
<<<<<<< HEAD
6160
TEMPORAL_SET, IDENTIFYING_DEFINITION, DESCRIBING_DEFINITION; // periodic temporal sets representing times that occur with some frequency (“Every Tuesday”).
62-
=======
63-
TEMPORAL_SET; // periodic temporal sets representing times that occur with some frequency (“Every Tuesday”).
64-
>>>>>>> d4d938f9778712a34ecc3e3335094b9e92a9c746
6561

6662
static {
6763
UNKNOWN_COORDINATION.coordination = true;

src/main/java/org/lambda3/text/simplification/discourse/runner/sentence_simplification/SentenceSimplifier.java

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)