Ejemplo n.º 1
0
        public static WatsonCorpusAddIntents CreateInstance(LexiconWorkspace workspace)
        {
            WatsonCorpusAddIntents instance = CreateInstance <WatsonCorpusAddIntents>();

            instance.workspace = workspace;
            return(instance);
        }
Ejemplo n.º 2
0
        public void SyncWatsonSpeechToText(LexiconWorkspace workspace, WorkspaceSyncData syncData)
        {
            workspace.WatsonSpeechToTextManager.IsSyncing  = true;
            workspace.WatsonSpeechToTextManager.SyncStatus = "Syncing";

            WatsonSyncQueue syncQueue = ScriptableObject.CreateInstance <WatsonSyncQueue>();

            syncQueue.workspace = workspace;
            syncQueue.syncData  = syncData;

            if (string.IsNullOrEmpty(workspace.WatsonSpeechToTextManager.CustomizationId))
            {
                syncQueue.Enqueue(WatsonCustomModelCreate.CreateInstance(workspace));
            }
            else
            {
                syncQueue.Enqueue(WatsonCustomWordsUpdate.CreateInstance(workspace));
                syncQueue.Enqueue(TimerSyncAction.CreateInstance(10));
            }

            syncQueue.Enqueue(WatsonCorpusAddIntents.CreateInstance(workspace));
            syncQueue.Enqueue(TimerSyncAction.CreateInstance(10));
            syncQueue.Enqueue(WatsonCorpusAddEntities.CreateInstance(workspace));
            syncQueue.Enqueue(TimerSyncAction.CreateInstance(10));
            syncQueue.Enqueue(WatsonCustomModelTrain.CreateInstance(workspace));
            syncQueue.Enqueue(TimerSyncAction.CreateInstance(10));

            syncQueue.OnCompleteAction = WatsonCompleteSpeechToTextSync.CreateInstance(workspace);
            syncQueue.OnQueueFinished += CleanUp;

            syncQueue.Process();

            watsonSpeechToTextSyncQueues.Add(syncQueue);
        }