示例#1
0
        private async Task <Example> ExtractFileFeatures(Document document, ExternalArgumentsDataset externalArgumentsDataset)
        {
            (_, Example example) = await externalArgumentsDataset.AddExample(document);

            example.SourcePath = document.FilePath;
            example.Features   = example.Features.Trim();
            return(example);
        }
示例#2
0
        private async Task <Example> ExtractFileFeatures(string filePath, ExternalArgumentsDataset externalArgumentsDataset)
        {
            string fileContent = File.ReadAllText(filePath);

            (_, Example example) = await externalArgumentsDataset.AddExample("", false, fileContent);

            example.SourcePath = filePath;
            example.Features   = example.Features.Trim();
            return(example);
        }
示例#3
0
        public async Task <Example> ScanFile(string filePath)
        {
            string fileContent = File.ReadAllText(filePath);

            (_, var example) = await externalArgumentsDataset.AddExample("", false, fileContent);

            example.SourcePath = filePath;
            example.Features   = example.Features.Trim();
            await ClassifyFile(example);

            return(example);
        }