コード例 #1
0
        private static async Task PredictLabelsAndUpdateGitHub(string ModelPath)
        {
            Console.WriteLine(".............Retrieving Issues from GITHUB repo, predicting label/s and assigning predicted label/s......");

            var token = Configuration["GitHubToken"];
            var repoOwner = Configuration["GitHubRepoOwner"]; //IMPORTANT: This can be a GitHub User or a GitHub Organization
            var repoName = Configuration["GitHubRepoName"];

            if (string.IsNullOrEmpty(token) || token == "YOUR - GUID - GITHUB - TOKEN" ||
                string.IsNullOrEmpty(repoOwner) || repoOwner == "YOUR-REPO-USER-OWNER-OR-ORGANIZATION" ||
                string.IsNullOrEmpty(repoName) || repoName == "YOUR-REPO-SINGLE-NAME" )
            {
                Console.Error.WriteLine();
                Console.Error.WriteLine("Error: please configure the credentials in the appsettings.json file");
                Console.ReadLine();
                return;
            }

            //This "Labeler" class could be used in a different End-User application (Web app, other console app, desktop app, etc.) 
            var labeler = new Labeler(ModelPath, repoOwner, repoName, token);

            await labeler.LabelAllNewIssuesInGitHubRepo();

            Console.WriteLine("Labeling completed");
            Console.ReadLine();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ghuntley/ml.net-examples
        static void Main(string[] args)
        {
            Predictor.Train();

            // Consider only issues with ID older tham minId. To look at all issues in the repo, set minId = 1.
            const int minId   = 1;
            var       labeler = new Labeler(GitHubUserName, GitHubRepoName, GitHubToken);

            labeler.LabelAllNewIssues(minId);

            Console.WriteLine("Labeling completed");
            Console.ReadLine();
        }
コード例 #3
0
        private static async Task Label()
        {
            var token    = ConfigurationManager.AppSettings["GitHubToken"];
            var userName = ConfigurationManager.AppSettings["GitHubUserName"];
            var repoName = ConfigurationManager.AppSettings["GitHubRepositoryName"];

            if (string.IsNullOrEmpty(token) ||
                string.IsNullOrEmpty(userName) ||
                string.IsNullOrEmpty(repoName))
            {
                Console.Error.WriteLine("error: please configure the credentials in the app.config");
                return;
            }

            var labeler = new Labeler(userName, repoName, token);

            await labeler.LabelAllNewIssues();

            Console.WriteLine("Labeling completed");
        }
コード例 #4
0
        private static async Task Label()
        {
            var token     = Configuration["GitHubToken"];
            var repoOwner = Configuration["GitHubRepoOwner"];
            var repoName  = Configuration["GitHubRepoName"];

            if (string.IsNullOrEmpty(token) ||
                string.IsNullOrEmpty(repoOwner) ||
                string.IsNullOrEmpty(repoName))
            {
                Console.Error.WriteLine();
                Console.Error.WriteLine("Error: please configure the credentials in the appsettings.json file");
                Console.ReadLine();
                return;
            }

            var labeler = new Labeler(repoOwner, repoName, token);

            await labeler.LabelAllNewIssues();

            Console.WriteLine("Labeling completed");
            Console.ReadLine();
        }
コード例 #5
0
        private static async Task PredictLabelsAndUpdateGitHub(string ModelPath)
        {
            var token     = Configuration["GitHubToken"];
            var repoOwner = Configuration["GitHubRepoOwner"]; //IMPORTANT: This can be a GitHub User or a GitHub Organization
            var repoName  = Configuration["GitHubRepoName"];

            if (string.IsNullOrEmpty(token) ||
                string.IsNullOrEmpty(repoOwner) ||
                string.IsNullOrEmpty(repoName))
            {
                Console.Error.WriteLine();
                Console.Error.WriteLine("Error: please configure the credentials in the appsettings.json file");
                Console.ReadLine();
                return;
            }

            //This "Labeler" class could be used in a different End-User application (Web app, other console app, desktop app, etc.)
            var labeler = new Labeler(ModelPath, repoOwner, repoName, token);

            await labeler.LabelAllNewIssuesInGitHubRepo();

            Console.WriteLine("Labeling completed");
            Console.ReadLine();
        }
コード例 #6
0
        private static void TestSingleLabelPrediction(string modelFilePathName)
        {
            var labeler = new Labeler(modelPath: ModelFilePathName);

            labeler.TestPredictionForSingleIssue();
        }