Exemplo n.º 1
0
    private void AddCachingFile(string pName, Stream pStream)
    {
        CachingFile item = new CachingFile(pName, pStream);

        lock (_lock)
        {
            //  파일정보 추가후 최대 캐싱갯수 넘으면 맨앞 삭제
            m_CachingFile_List.Add(item);
            if (m_MaxCachingNum < m_CachingFile_List.Count)
            {
                //  맨앞 지움
                m_CachingFile_List[0].m_Stream.Close();
                m_CachingFile_List.RemoveAt(0);
            }
        }
    }
Exemplo n.º 2
0
        public TargetIdentificator(string word2VecModelPath)
        {
            lexParser = LexicalizedParser.loadModel(@"Resources\englishPCFG.ser.gz");
            grammaticalStructureFactory = new PennTreebankLanguagePack().grammaticalStructureFactory();

            lemmatizer = IStemmer.GetLemmatizer();

            wordNetEngine = new WordNetEngine();
            wordNetEngine.LoadFromDirectory(@"Resources\WordNet");

            word2VecVocabulary = new Word2VecBinaryReader().Read(word2VecModelPath);

            MLContext    mlContext = new MLContext();
            ITransformer mlModel   = mlContext.Model.Load("MLModel.zip", out _);

            predictionEngine = mlContext.Model.CreatePredictionEngine <ModelInput, ModelOutput>(mlModel);

            wiki = new Wiki("NLP/1.0", "https://en.wikipedia.org", "https://en.wikipedia.org/w/api.php");

            caching = new CachingFile();
        }
Exemplo n.º 3
0
 public TargetCandidate(NounPhrase nounPhrase, CachingFile caching)
 {
     NounPhrase       = nounPhrase;
     this.caching     = caching;
     sentimentLexicon = new SentimentLexicon();
 }