From 2d6902d934759e17a93b306a996f385f1bf94c96 Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@lis-lab.fr> Date: Fri, 3 Jun 2022 14:04:38 +0200 Subject: [PATCH] Added network type LexiconNoLetters --- Networks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Networks.py b/Networks.py index 32daab1..eab5e49 100644 --- a/Networks.py +++ b/Networks.py @@ -32,9 +32,9 @@ def loadW2v(w2vFile, weights, dicts, colname) : ################################################################################ def getNeededDicts(name) : names = ["FORM","UPOS"] - if "Lexicon" in name : + if "lexicon" in name.lower() : names.append("LEXICON") - if "NoLetters" not in name : + if "noletters" not in name.lower() : names.append("LETTER") return names @@ -56,6 +56,8 @@ def createNetwork(name, dicts, outputSizes, incremental, pretrained, hasBack) : return BaseNet(dicts, outputSizes, incremental, featureFunctionAll, historyNb, historyPopNb, suffixSize, prefixSize, columns, 3200, 128, pretrained, hasBack) elif name == "baseNoLetters" : return BaseNet(dicts, outputSizes, incremental, featureFunctionAll, historyNb, historyPopNb, 0, 0, columns, 1600, 64, pretrained, hasBack) + elif name == "lexiconNoLetters" : + return BaseNet(dicts, outputSizes, incremental, featureFunctionAll, historyNb, historyPopNb, 0, 0, ["UPOS", "LEXICON"], 1600, 64, pretrained, hasBack) elif name == "tagger" : return BaseNet(dicts, outputSizes, incremental, featureFunctionNostack, historyNb, historyPopNb, suffixSize, prefixSize, columns, 1600, 64, pretrained, hasBack) elif name == "taggerLexicon" : -- GitLab