@@ -19,6 +19,7 @@ What things you need to install and how to install them
- Keras 2.2.4
- Tensorflow-hub
- ConceptNet 5.6.0
- matplotlib
```
@@ -40,39 +41,53 @@ To execute the project, you must first select a dataset. <br>
The Dataset has to be annotated manually, which is then used as the gold standard. <br>
For Annotation we used Maslow and Reiss motives. Maslow's hierarchy of needs is a motivational theory in psychology comprising a five-tier model of human needs, often depicted as hierarchical levels within a pyramid. Reiss builds on this pyramid, adding finer terms to each category. Each of us four annotated hundred of the fourhundred essays with a Maslow and a Reiss motive. We then used Fleiss Kappa for calculation of the Inter Annotater Agrrement. <br> The data must then be prepared accordingly. A test file and a train file. How these must look exactly, can be taken from our attached files.
### Break down into end to end tests
## Steps to get started <br>
Explain what these tests test and why
### Pre-work
First of all, two code files must be executed: Comparer.py and Readhumans.py. The Comparer.py requires the concept-net-assertions-5.6.0 and the selected dataset. The output is a concept-filtered and lemmatized set of words from each input set. When executing the Comparer code, the concrete path where the dataset is located must be specified. After that ontology_create has to be executed for the list with the concepts. Then the sets are split and lemmatized. Run through matching_dicts for final result with concepts. <br> Second, the Readhumans.py file is executed. As training set we use the ROCStories dev-set. The output is a file with the individual components of the set (e.g. file name). To choose the right directory in line 338 the file has to be edited specificly (dev -> motiv -> allcharlines).
<br><br>
```
Give an example
```
Graphpath: Path to constructed Concepts concept_graph_full <br>
Outputpath: Path to (empty) File, purpose written behind as _[purpose]
Purpose: --dev | --train | --test
### And coding style tests
### Start coding
To work, we use the steps provided by Debjit Paul from Ranking and Selecting Multi-Hop Knowledge Paths to Better Predict Human Needs (NAACL 2019)'. However, we had to modify and adapt these steps, which is why our given steps are slightly different from his. <br>
Explain what these tests test and why
### Construct ConceptNet into a graph
Prerequisite for this step is the previous download of the concept-net-assertions-5.6.0.csz.gz.
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
## Versioning
### Extracting relevant knowledge paths from subgraphs
Inputpath: path to inputfile from step 2 <br>
Outputpath: path to txt.file where extracted knowledgepaths can be saved <br>
Input: subgraphs and inputfile from step 2<br>
Output: .txtfile with knowledgepaths for each sentence
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
```
python src/graph_model/extract_path3.py
```
## Authors
@@ -81,10 +96,23 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available,
* Dorian Heide
* Stefanie Kühner
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
## Acknowledgments
* Special thanks to @debjitpaul who took his time for zoom calls with us and helped us working through error messages and getting his program started.
## Reference
@inproceedings{paul-frank-2019-ranking,
title = "Ranking and Selecting Multi-Hop Knowledge Paths to Better Predict Human Needs",
author = "Paul, Debjit and
Frank, Anette",
booktitle = "Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)",
month = jun,
year = "2019",
address = "Minneapolis, Minnesota",
publisher = "Association for Computational Linguistics",
abstract = "To make machines better understand sentiments, research needs to move from polarity identification to understanding the reasons that underlie the expression of sentiment. Categorizing the goals or needs of humans is one way to explain the expression of sentiment in text. Humans are good at understanding situations described in natural language and can easily connect them to the character{'}s psychological needs using commonsense knowledge. We present a novel method to extract, rank, filter and select multi-hop relation paths from a commonsense knowledge resource to interpret the expression of sentiment in terms of their underlying human needs. We efficiently integrate the acquired knowledge paths in a neural model that interfaces context representations with knowledge using a gated attention mechanism. We assess the model{'}s performance on a recently published dataset for categorizing human needs. Selectively integrating knowledge paths boosts performance and establishes a new state-of-the-art. Our model offers interpretability through the learned attention map over commonsense knowledge paths. Human evaluation highlights the relevance of the encoded knowledge.",