Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ChunkerModel"/> class using a <see cref="T:ISequenceClassificationModel{string}"/> as the chunker model.
        /// </summary>
        /// <param name="languageCode">The language code.</param>
        /// <param name="chunkerModel">The chunker model.</param>
        /// <param name="manifestInfoEntries">The manifest information entries.</param>
        /// <param name="factory">The chunker factory.</param>
        public ChunkerModel(string languageCode, ISequenceClassificationModel <string> chunkerModel, Dictionary <string, string> manifestInfoEntries, ChunkerFactory factory)
            : base(ComponentName, languageCode, manifestInfoEntries, factory)
        {
            artifactMap.Add(ChunkerEntry, chunkerModel);

            CheckArtifactMap();
        }
Exemplo n.º 2
0
        public POSModel(
            string languageCode,
            ISequenceClassificationModel <string> posModel,
            Dictionary <string, string> manifestInfoEntries,
            POSTaggerFactory posFactory) : base(ComponentName, languageCode, manifestInfoEntries, posFactory)
        {
            if (posModel == null)
            {
                throw new ArgumentNullException("posModel");
            }

            // TODO: This fails probably for the sequence model ... ?!

            artifactMap[EntryName] = posModel;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TokenNameFinderModel" /> class.
        /// </summary>
        /// <param name="languageCode">The language code.</param>
        /// <param name="nameFinderModel">The name finder model.</param>
        /// <param name="generatorDescriptor">The generator descriptor.</param>
        /// <param name="resources">The resources.</param>
        /// <param name="manifestInfoEntries">The manifest information entries.</param>
        /// <param name="seqCodec">The sequence codec.</param>
        /// <param name="factory">The tool factory.</param>
        /// <exception cref="InvalidOperationException">Model not compatible with name finder!</exception>
        /// <exception cref="System.InvalidOperationException">Model not compatible with name finder!</exception>
        public TokenNameFinderModel(
            string languageCode,
            ISequenceClassificationModel<string> nameFinderModel,
            byte[] generatorDescriptor,
            Dictionary<string, object> resources,
            Dictionary<string, string> manifestInfoEntries,
            ISequenceCodec<string> seqCodec,
            TokenNameFinderFactory factory)
            : base(ComponentName, languageCode, manifestInfoEntries, factory) {
            Init(nameFinderModel, generatorDescriptor, resources, seqCodec);

            if (!seqCodec.AreOutcomesCompatible(nameFinderModel.GetOutcomes())) {
                throw new InvalidOperationException("Model not compatible with name finder!");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TokenNameFinderModel"/> class.
        /// </summary>
        /// <param name="languageCode">The language code.</param>
        /// <param name="nameFinderModel">The name finder model.</param>
        /// <param name="generatorDescriptor">The generator descriptor.</param>
        /// <param name="resources">The resources.</param>
        /// <param name="manifestInfoEntries">The manifest information entries.</param>
        /// <param name="sequenceCodec">The sequence codec.</param>
        /// <exception cref="System.InvalidOperationException">Model not compatible with name finder!</exception>
        public TokenNameFinderModel(
            string languageCode,
            ISequenceClassificationModel <string> nameFinderModel,
            byte[] generatorDescriptor,
            Dictionary <string, object> resources,
            Dictionary <string, string> manifestInfoEntries,
            ISequenceCodec <string> sequenceCodec)
            : base(ComponentName, languageCode, manifestInfoEntries)
        {
            Init(nameFinderModel, generatorDescriptor, resources, sequenceCodec);

            if (!sequenceCodec.AreOutcomesCompatible(nameFinderModel.GetOutcomes()))
            {
                throw new InvalidOperationException("Model not compatible with name finder!");
            }
        }
Exemplo n.º 5
0
        public POSModel(
            string languageCode, 
            ISequenceClassificationModel<string> posModel,
            Dictionary<string, string> manifestInfoEntries,
            POSTaggerFactory posFactory) : base(ComponentName, languageCode, manifestInfoEntries, posFactory) {
            
            if (posModel == null)
                throw new ArgumentNullException("posModel");

            // TODO: This fails probably for the sequence model ... ?!

            artifactMap[EntryName] = posModel;

        }