Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update bash file
  • Loading branch information
cxchu committed Apr 22, 2020
1 parent 4516dfe commit aacc3e7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 39 deletions.
3 changes: 0 additions & 3 deletions Note.txt

This file was deleted.

2 changes: 0 additions & 2 deletions kill.sh

This file was deleted.

14 changes: 6 additions & 8 deletions resources/wikia.properties
Expand Up @@ -2,7 +2,13 @@
############### which includes data file path, parameters, etc. #######
#######################################################################

##directory stores the background KB of all universes
BASE_DIR = /var/tmp/wikia/entity-typing/data-store/
##directory stores the pre-trained model of fictional typing module
ATTENTION_MODEL = /local/var/tmp/wikia/entity-typing/deep-learning/
##directory stores the universe-term matrix for reference universe ranking
TERMMATRIX = /var/tmp/wikia/all-data/top-k-universe-termmatrix/


WIKIA_TYPE_SYSTEM_PATH = /type-hierarchy

Expand All @@ -28,12 +34,6 @@ WIKIA_BACKGROUND_FACT_DICTIONARY = /fact-dictionary
WIKIA_BACKGROUND_TIME_DICTIONARY = /time-dictionary
WIKIA_BACKGROUND_STATISTIC = /bkb-statistic

# html dump file after remove unneccessary parts, just keep: infobox, maintext, category, title and id
#/var/tmp/wikia/entity-typing/data-store/religion/

#WIKIA_DIR = /var/tmp/wikia/all-data/wikia-top-dumpfile/
#WIKIA_DIR = /var/tmp/wikia/entity-typing/input-data/
#WIKIA_DIR = /GW/D5data-9/cxchu/wikia/all-data/dumpfile-available-universes/
# stopwords
STOPWORDS = stopwords_en.txt

Expand All @@ -43,5 +43,3 @@ TOKEN_CONTEXT_COMPRESS_RATE = 0.2
# if context size < STANDARD_TOKEN_CONTEXT_SIZE, take STANDARD_TOKEN_CONTEXT_SIZE
STANDARD_TOKEN_CONTEXT_SIZE = 100

TERMMATRIX = /var/tmp/wikia/all-data/top-k-universe-termmatrix/
ATTENTION_MODEL = /local/var/tmp/wikia/entity-typing/deep-learning/
23 changes: 0 additions & 23 deletions run_parallel.sh

This file was deleted.

16 changes: 13 additions & 3 deletions src/typing/ENTYFI.java
Expand Up @@ -2,6 +2,8 @@

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -17,8 +19,10 @@
import ranking.ReferenceUnivRanking;
import segmentation.InputSegmentation;
import utils.Configuration;
import utils.ReadFile;
import utils.SortedMultiMap;
import utils.StringUtils;
import utils.Util;


public class ENTYFI {
Expand Down Expand Up @@ -227,7 +231,11 @@ public Pair<String, List<String>> run(String data) throws IOException, SQLExcept

public static void main(String[] args) throws IOException, SQLException {

String input = "In the Red Keep, Tyrion, escorted by Ser Gregor, meets Jaime, who confirms that he believes the threat of the Dead, but has been unable to convince Cersei. Jamie is killed. .";
String inputFile = Util.getArg(args, 0, "test-data/input.txt");
String outputFile = Util.getArg(args, 1, "test-data/output.txt");

String input = ReadFile.readFile(inputFile);
System.out.println(input);
int check = 0;
int topKUniverse = 1;
int topKTypes = 10;
Expand All @@ -237,10 +245,12 @@ public static void main(String[] args) throws IOException, SQLException {
ENTYFI entyfi = new ENTYFI(segmentation, check, topKUniverse, topKTypes);
Pair<String, List<String>> res = entyfi.run(input);
System.out.println(res.first);

Writer out = new PrintWriter(new File(outputFile));
for (String s: res.second){
System.out.println(s);
out.write(s + "\n");
}

out.close();
}

}
1 change: 1 addition & 0 deletions test-data/input.txt
@@ -0,0 +1 @@
In the Red Keep, Tyrion, escorted by Ser Gregor, meets Jaime, who confirms that he believes the threat of the Dead, but has been unable to convince Cersei. Jamie is killed.

0 comments on commit aacc3e7

Please sign in to comment.