IntelliCode 開發團隊:基於代碼的 AI 輔助 IntelliSenseIntelliCode team completions: AI-assisted IntelliSense based on your code

使用 IntelliCode 團隊模型完成,以便根據您的 C# 和 C++代碼庫獲得 AI 輔助的 IntelliSense 建議。Use IntelliCode team models for completions to get AI-assisted IntelliSense recommendations based on your C# and C++ codebases. 在使用開放原始碼中未常用的類型或特定於域的庫時,團隊完成非常有用。Team completions are useful when working with your own types or domain-specific libraries that aren’t commonly used in open source code. 這是因為 IntelliCode 之「基本模型」建議完全根據從開放原始碼 GitHub 存放庫學習到的模式。This is because IntelliCode’s base model recommendations are based solely on patterns learned from open-source GitHub repos. 當使用不在該存儲庫集中的代碼時,這些建議對您沒有用處。When working with code that isn’t in that set of repos, those recommendations aren't as useful to you. Visual Studio 中的 C# 和C++用戶現在可以使用 IntelliCode 從代碼中學習模式,以便_根據您的_程式碼客製建議。C# and C++ users in Visual Studio can now use IntelliCode to learn patterns from their code to make recommendations tailored to your code.

IntelliCode 模型是一組規則的封裝,允許根據代碼分析預測一些有用的資訊(例如,IntelliSense 清單中的建議)。An IntelliCode model is an encapsulation of a set of rules that allow prediction of some useful information (for example, recommendations in the IntelliSense list) based on an analysis of code. IntelliCode 使用與 IntelliCode 基礎模型相同的學習過程創建團隊模型,除非它們根據您自己的代碼進行培訓。IntelliCode creates team models using the same learning process as for the IntelliCode base models, except they are trained on your own code. 您提供的代碼越多,您的使用模式就越有能力提供有用的建議。The more code you provide to illustrate your patterns of usage, the more capable your team model will be at offering useful recommendations.

為了構建您的團隊模型,我們提取一個包含您類型及其用法的元數據的摘要檔,並將其安全地上傳到我們的服務。To build your team model, we extract a summary file with metadata on your types and their usages and securely upload it to our service.

注意

團隊完成是 Visual Studio版本 16.4 預覽 4及以上中的預覽功能,默認情況下處於禁用狀態。Team completions are a preview feature in Visual Studio version 16.4 preview 4 and above and are disabled by default. 可以透過工具 > 選項 > IntelliCode 開啟It can be enabled through Tools > Options > IntelliCode. 它們目前僅適用於 C# 和C++代碼。They are currently available only for C# and C++ code.

如何套用模型How models get applied

IntelliCode 藉由合併以下各項,從多個模型產生建議:IntelliCode generates its recommendations from multiple models by merging together:

  • 所使用語言的基本模型 (這是以上千個公用 GitHub 存放庫所定型)The base model for the language you're using (which is trained on thousands of public GitHub repos)
  • 您培訓過的任何團隊模型Any team models you've trained
  • 與您正在處理的 Git 儲存函式庫關聯的任何團隊模型Any team models which are associated with the Git repository you’re working in
  • 您透過分享其他人為您提供的連結到您的個人資料中的任何團隊模型Any team models you've added to your profile from sharing links that others gave you

您不需要管理哪些模型適用於哪個解決方案或程式碼基底,因為 IntelliCode 會為您代勞。You don't need to manage which models apply to which solution or codebase because IntelliCode takes care of this for you.

團隊完成模型的類型Types of team completions models

您可以透過兩種方式取得團隊完成模型:You are two ways you can obtain team completions models:

  1. 與存儲庫關聯的:模型綁定到存儲庫,所有可以克隆和編輯存儲庫的使用者都被授予對模型的自動存取許可權。Repository-associated: Models are tied to the repository and all users who can clone and edit the repository are granted automatic access to the model. 有關詳細資訊,請參閱自動取得團隊模型See automatic acquisition of team models for more information.

    • 您的代碼庫必須在 Git 原始程式碼控制下並推送到遠端以創建與儲存庫關聯的模型。Your codebase must be under Git source control and pushed to a remote to create a repository-associated model.
  2. 與使用者關聯的:模型與您的個人身份相關聯,必須通過共用連結與他人共用。User-associated: Models are tied to your personal identity and must be shared with others through a sharing link.

    • 這種類型的團隊模型僅適用於 C#,並將於明年棄用。This type of team model is only available for C# and will be deprecated in the next year.

儲存函式庫關聯的團隊模型Repository-associated team models

建立完成模型Create your completions model

若要取得有用的預測,程式碼基底應該為您所使用的 API、物件和方法呈現一般的使用模式。To get useful predictions, a codebase should represent the common usage patterns for the APIs, objects, and methods that you use. 具有各種常見使用模式的代碼庫將創建一個模型,為更多情況提供有用的結果。A codebase with a wide variety of common usage patterns will create a model that provides useful results for more cases.

需求:Requirements:

  • 存儲庫尚未對存儲庫中已訓練了存儲庫關聯的模型。The repository must not already have a repository-associated model already trained on it.

  • 存儲庫必須受 Git 原始程式碼管理。The repository must be under Git source control.

  • 您必須在工具 > 選項 > IntelliCode中啟用以下設定。You must enable the following settings in Tools > Options > IntelliCode.

    • C# 或C++團隊模型,用於完成C# or C++ team models for completions
    • 取得完成團隊模型Acquire team models for completions

    注意

    如果您沒有看到上述設置,請確保至少安裝了Visual Studio 版本 16.4 預覽版 4或以上。If you don't see the above settings, be sure that you have installed at least Visual Studio version 16.4 preview 4 or above. 安裝預覽後,您可以通過工具 > 選項 > IntelliCode啟用獲取團隊模型以完成。Once the preview has been installed, you can enable acquiring team models for completions through Tools > Options > IntelliCode.

要訓練與存儲庫關聯的模型,請按照以下步驟操作:To train a repository-associated model, follow these steps:

  1. 使用要訓練的解決方案克隆存儲庫。Clone the repository with the solution you’d like to train on.
  2. 在 Visual Studio 中打開解決方案或儲存庫資料夾。Open the solution or repository folder in Visual Studio.
  3. 通過在此存儲庫上查看 > 其他 Windows > 訓練 IntelliCode 模型或在可視化工作室搜索 (Ctrl + Q) 中搜索命令來創建模型。Create a model by going to View > Other Windows > Train IntelliCode model on this repository or by searching for the command in Visual Studio Search (Ctrl + Q).
  4. 系統將提示您使用要使用的帳戶登錄。You’ll be prompted to sign-in with the account you’d like to use.
  5. 成功創建模型後,它將自動下載到 Visual Studio。Upon successful creation of the model, it will be automatically downloaded to Visual Studio. 您可以透過開啟輸出視窗並在下拉清單中切換到 IntelliCode 來追蹤模型的進度。You can track the model’s progress by opening the Output Window and switching to IntelliCode in the dropdown.

還可以透過將生成任務整合到Azure DevOps CI 管道中來建構與儲存庫相關的模型。You can also build a repository-associated model by integrating our build task as part of your Azure DevOps CI pipeline.

注意

您必須在 Visual Studio 開啟程式碼的解決方案或資料夾,才能訓練模型。You must open a solution or folder of code in Visual Studio in order to train a model.

重新訓練模型Retrain your model

對於 AI 輔助的 IntelliSense 建議,如果進行更改(如重命名方法或添加新方法),模型將變為過時。For AI-assisted IntelliSense recommendations, the model becomes stale if you make changes such as renaming a method or adding new methods. 在重新訓練這些更改之前,模型不會知道這些更改。The model doesn't know about those changes until you train it again. 如果您已對程式碼基底進行許多變更或新增,請考慮將根據它建立的任何模型重新定型。If you've made numerous changes or additions to a codebase, consider retraining any models that were created from it.

您可以通過打開關聯的儲存庫並在此儲存庫上查看 > 其他 Windows > 訓練IntelliCode 模型或作為連續整合 (CI) 管道的一部分自動重新訓練模型來手動重新訓練模型。You can retrain your model manually by opening the associated repository and going to View > Other Windows > Train IntelliCode model on this repository or automatically as part of a continuous integration (CI) pipeline.

除非您進行了重大的代碼更改,並且希望看到這些更改反映在 IntelliCode 的建議中,否則重新訓練模型沒有任何好處。There's no benefit to retraining your model unless you’ve made significant code changes and would like to see those changes reflected in IntelliCode's recommendations.

在 Azure 管道中自動建立與重新訓練模型Automatically create and retrain a model in Azure Pipelines

作為Azure 管道中連續整合 (CI) 管道的一部分,可以自動創建和重新訓練模型。You can automatically create and retrain a model as part of your continuous integration (CI) pipeline in Azure Pipelines. 當代碼更改推送到儲存庫並運行生成任務時,將重新訓練完成團隊模型,然後提供給與您共用模型的每個人。When code changes are pushed to your repository and the build task runs, the team model for completions is retrained and then made available to everyone that you've shared the model with. Visual Studio 定期檢查完成模型的更新,並會自動將更新下載到您的團隊模型。Visual Studio periodically checks for updates to completions models and will download updates to your team model automatically.

開始之前,請確保:Before you start, make sure that:

  • 您有權為專案創建和編輯管道。You have permission to create and edit pipelines for the project.
  • 您的專案使用 Git 原始程式碼管理。Your project uses Git source control.
  • 生成代理已安裝最低必需版本的可視化工作室。The build agent has the minimum required version of Visual Studio installed.
    • 對於 C# 儲存庫:視覺工作室 2017 或更高版本For C# repositories: Visual Studio 2017 or higher
    • 對於C++存儲庫:可視化工作室 2019 更新 4 或更高版本For C++ repositories: Visual Studio 2019 Update 4 or higher
  • IntelliCode 任務必須在管道啟動后 1 小時內完成。The IntelliCode task must be completed within 1 hour of the start of the pipeline.
    • 如果構建過程較長,我們建議您為 IntelliCode 任務設置更簡單的管道。We recommend setting up a simpler pipeline for the IntelliCode task if you have a lengthy build process.
  • 您已啟用了團隊模型的獲取。You have enabled acquisition of team models. 您可以在工具 > 選項 > IntelliCode > 中驗證這個設定 ,取得團隊模型以完成You can verify this setting in Tools > Options > IntelliCode > Acquire team models for completions.

安裝程式Setup

  1. 可視化工作室 IntelliCode 生成任務從可視化工作室應用商店安裝到 Azure DevOps 組織,然後選擇要將任務添加到的組織。Install the Visual Studio IntelliCode Build task from Visual Studio Marketplace to your Azure DevOps organization and select the organization you’d like to add the task to.

    Azure DevOps 組織選擇螢幕

    • 此任務掃描原始碼並提取創建 IntelliCode 模型所需的資料。This task scans your source code and extracts the data it needs to create an IntelliCode model. 提取的數據將上載到 IntelliCode 服務,該服務將創建模型並將其與您的帳戶關聯。The extracted data is uploaded to the IntelliCode service, which creates the model and associates it with your account.
  2. 為 IntelliCode 設定服務連線Set up a service connection for IntelliCode. 您只需執行此操作一次,同一連接即可重新用於多個管道。You only need to do this once, the same connection can be reused for multiple pipelines.

    Azure DevOps 服務連接螢幕

使用YAML 編輯器在 Azure 管道中設定團隊模型建立並重新訓練Set up team model creation and retraining in Azure Pipelines using the YAML editor

  1. 在助理窗格中搜索並添加 IntelliCode 任務。Search for and add the IntelliCode task in the assistant pane. 新增 IntelliCode 產生工作Add IntelliCode build task

  2. 在任務配置窗格中,鍵入要在其中訓練模型的分支。In the task configuration pane, type the branch that you want to train the model on.

    • 我們建議使用任何持久分支,如主分支或發佈分支。We recommend using any persistent branch such as master or a release branch.
  3. 從下拉清單中選擇要用於此任務的 IntelliCode 服務連接。Select the IntelliCode service connection you'd like to use for this task from the dropdown.

    • 如果沒有可用的服務連接,則需要先創建一個連接,然後才能繼續。If you don't have an available service connection, you'll need to create one before you can proceed.

    設定 IntelliCode 產生工作

  4. 確保在生成步驟後執行 IntelliCode 模型訓練任務。Ensure the IntelliCode Model Training task occurs after your build step.

  5. 保存並運行管道以創建模型。Save and run your pipeline to create your model.

  6. 在 Visual Studio 中從管道中打開相應的儲存庫,在管道完成後通過自動團隊模型採集功能下載創建的團隊模型。Open the corresponding repository from your pipeline in Visual Studio to download the created team model via the automatic team model acquisition feature after your pipeline completes.

  7. 您的模型將自動更新並與每個CI生成共用。Your model will be automatically updated and shared with each CI build.

使用經典編輯器在 Azure 管道中設定團隊模型建立與重新訓練Set up team model creation and retraining in Azure Pipelines using the classic editor

  1. 將 IntelliCode 生成任務添加到管道中。Add the IntelliCode Build task to your pipeline. 將其放在任何生成任務之後。Place it after any build tasks.

    將訓練工作到導管

  2. 在任務配置窗格中,選擇要在其中訓練模型的分支。In the task configuration pane, select the branch that you want to train the model on. 我們建議使用任何持久分支,如主分支或發佈分支。We recommend using any persistent branch such as master or a release branch.

    設定 IntelliCode 工作

  3. 從下拉清單中選擇現有的 IntelliCode 連接,或選擇「新建」以創建與 IntelliCode 服務的新 OAuth 2.0 連接。Select an existing IntelliCode connection from the dropdown or select New to create a new OAuth 2.0 connection to the IntelliCode service. 此連接用於上載訓練數據以創建模型。This connection is used to upload the training data to create the model.

    新增 IntelliCode 服務連線

  4. 保存並運行管道以創建團隊模型。Save and run your pipeline to create your team model.

  5. 在 Visual Studio 中打開相應的儲存庫到管道,以便在管道完成後透過自動團隊模型採集功能自動下載創建的團隊模型。Open the corresponding repository to your pipeline in Visual Studio to to automatically download the created team model via the automatic team model acquisition feature after your pipeline completes.

  6. 您的模型將隨每個 CI 生成自動更新。Your model will be automatically updated with each CI build.

分享與儲存庫關聯的模型Sharing your repository-associated models

只要使用者在 Visual Studio 中啟用自動獲取團隊模型,存儲庫關聯的模型將自動與在同一代碼庫中工作的其他人共用。Repository-associated models are automatically shared with others working in the same codebase as long as users have enabled automatic acquisition of team models in Visual Studio. 通過訪問工具 > 選項 > IntelliCode > 獲取團隊模型來完成實現自動採集。Enable automatic acquisition by going to Tools > Options > IntelliCode > Acquire team models for completion.

當任何人克隆並打開已訓練模型的代碼庫時,將下載並啟動與配置的 Git 遠端存儲庫關聯的任何模型。When anyone clones and opens the codebase the model was trained on, any models associated with the configured Git remote repositories will be downloaded and activated. 如果您正在處理代碼庫的分叉,只需將上游代碼庫添加為遠端存儲庫即可獲取模型。If you are working on a fork of the codebase, simply add the upstream codebase as a remote repository to get the model.

對存儲庫的訪問是對模型的訪問。Access to the repository is access to the model. 培訓時,我們會收集有關簽出提交的資訊。When training, we collect some information about the checked-out commit. 請求該模型的任何人必須在其存儲庫中具有相同的提交,並能夠生成培訓期間收集的相同資訊,以便接收團隊模型。Anyone who requests that model must have the same commit in their repository and be able to produce the same information that was collected during training in order to receive the team model.

您還可以透過查看 > 其他 Windows > IntelliCode 模型管理、從左邊窗格中選擇模型以及點擊 「共用」按鈕來共用模型。You can also share your model by going to View > Other Windows > IntelliCode Model Management, selecting your model from the left pane, and hitting the Share button. 這將生成共享連結,您可以將其發送給要與誰共用模型。This generates a sharing link you can send to anyone you'd like to share the model with.

移除模型Delete your model

您可以從帳戶移除模型,讓它們不再可用。You can remove models from your account so they can no longer be used.

移除在視覺化工作室建立的儲存庫關聯模型Delete a repository-associated model created within Visual Studio

  1. 通過查看 > 其他 Windows > 清單IntelliCode 模型來查找模型 ID。Find the model ID by going to View > Other Windows > List IntelliCode models.
    • 您還可以在視覺化工作室搜尋 (Ctrl + Q) 中搜尋清單智慧代碼模型You can also search for List IntelliCode models in Visual Studio Search (Ctrl + Q).
  2. 系統將提示您使用訓練模型時使用的帳戶登錄。You’ll be prompted to sign-in with the account you used when you trained the model.
  3. 複製要刪除的模型的型號 ID。Copy the model ID for the model you’d like to delete.
    • 您有權存取的所有 IntelliCode 模型都將在「輸出」視窗中列出。All IntelliCode models you have access to will be listed in the Output window.
  4. 跳到檢視 > 其他 Windows > 刪除 IntelliCode 模型Go to View > Other Windows > Delete IntelliCode models. 將模型 ID 貼上到框中,然後點擊 「刪除」 。Paste the model ID into the box and hit Delete.

移除從 Azure DevOps 工作建立的模型Delete a model created from the Azure DevOps task

  1. 從管道中刪除可視化工作室 IntelliCode 團隊模型訓練任務。Delete the Visual Studio IntelliCode Team Model Training task from your pipeline.
  2. 打開視覺化工作室,並透過查看 > 其他 Windows > 清單 IntelliCode 模型搜尋模型 ID。Open Visual Studio and find the model ID by going to View > Other Windows > List IntelliCode models.
    • 您還可以在可視化工作室搜索 (Ctrl + Q) 中搜索列表智慧代碼模型。You can also search for List IntelliCode models in Visual Studio Search (Ctrl + Q).
  3. 系統將提示您使用用於在 Azure DevOps 中設置 IntelliCode 服務連接的相同帳戶登錄。You’ll be prompted to sign-in with the same account you used to set up the IntelliCode service connection in Azure DevOps.
  4. 複製要刪除的模型的型號 ID。Copy the model ID for the model you’d like to delete.
    • 您有權存取的所有 IntelliCode 模型都將在「輸出」視窗中列出。All IntelliCode models you have access to will be listed in the Output window.
  5. 跳到檢視 > 其他 Windows > 刪除 IntelliCode 模型Go to View > Other Windows > Delete IntelliCode models. 將模型 ID 貼上到框中,然後點擊 「刪除」 。Paste the model ID into the box and hit Delete.

刪除模型后,您的請求將從您的帳戶中刪除模型,數據將在 72 小時內從 IntelliCode 的系統中清除。When you delete your models, your request will remove the model from your account, and the data will be purged from IntelliCode’s systems within 72 hours.

使用者關聯的團隊模型User-associated team models

注意

使用者關聯的團隊完成模型將在下一年棄用。User-associated team completions models will be deprecated in the next year. 我們鼓勵您利用與存儲庫相關的團隊模型前進。We encourage you to utilize repository-associated team models moving forward.

建立您的模型Create your model

注意

團隊完成是 C# 的預覽功能,默認情況下處於禁用狀態。Team completions is a preview feature for C# and is disabled by default. 它可以通過工具>選項> intelliCode > C# 團隊模型進行完成。It can be enabled through Tools > Options > IntelliCode > C# team models for completions.

訓練使用者關聯的模型:Train a user-associated model:

  1. 在 Visual Studio 中開啟專案或解決方案。Open the project or solution in Visual Studio.
  2. 通過選擇「查看 >其他 Windows > intelliCode 模型管理」打開 IntelliCode 頁面。Open the IntelliCode page by choosing View > Other Windows > IntelliCode Model Management.
  3. 選擇 [建立新的模型]****。Choose Create new model.

共用您的模型Share your model

在您定型好模型之後,[共用模型]**** 按鈕會隨即出現。After you've trained a model, the Share model button appears. 按一下按鈕即可複製共用連結。Click the button to copy the sharing link. 您可以從該處與共同作業者共用連結。From there, you can share the link with your collaborators.

注意

具有共用連結的人都可以存取模型和其建議,因此請確定收到連結的每個人都對此了解。Anyone who has the sharing link can access the model and its suggestions, so make sure that everyone who receives the link is aware of this.

透過共用功能,您想與多少人共用您的模型都可以。You can share your model with as many people as you like via the sharing feature. 小組成員無法重新定型模型,但他們可以看到和您一樣的完成建議。Team members can't retrain the model but they do see the same completion recommendations as you do.

有關共用完成模型的詳細資訊,請參閱如何:共用自定義模型For more information about sharing completions models, see How to: Share custom models.

重新訓練模型Retrain your model

如果進行更改(如重命名方法或添加新方法),則團隊模型將過時。Your team model becomes stale if you make changes such as renaming a method or adding new methods. 在重新訓練這些更改之前,模型不會知道這些更改。The model doesn't know about those changes until you train it again. 如果您已對程式碼基底進行許多變更或新增,請考慮將根據它建立的任何模型重新定型。If you've made numerous changes or additions to a codebase, consider retraining any models that were created from it.

除非您進行了重大的代碼更改,並且希望看到這些更改反映在 IntelliCode 的建議中,否則重新訓練模型沒有任何好處。There's no benefit to retraining your model unless you’ve made significant code changes and would like to see those changes reflected in IntelliCode's recommendations.

刪除模型Delete a model

您可以從帳戶移除模型,讓它們不再可用。You can remove models from your account so they can no longer be used. 若要這樣做,請在 Visual Studio 中,選擇 IntelliCode 定型頁面上的 [刪除]**** 按鈕。To do this, choose the Delete button on the IntelliCode training page in Visual Studio.

在 Visual Studio 中刪除 IntelliCode 模型

刪除模型后,您的請求將從您的帳戶中刪除模型,數據將在 72 小時內從 IntelliCode 的系統中清除。When you delete your models, your request will remove the model from your account, and the data will be purged from IntelliCode’s systems within 72 hours.

根據公用程式碼基底定型Train on a public codebase

在訓練自己的代碼之前,您可能希望在公共代碼庫上創建完成模型。Before you train on your own code, you might want to create a completions model on a public codebase. 您可以看到完成模型如何影響 IntelliSense,或者如果您擔心 IntelliSense 收集的數據類型,則可以檢查提取的數據。You can see how the completions model affects IntelliSense, or if you're concerned about the kind of data that IntelliSense collects, you can inspect the extracted data. 定型的一些有趣範例如下:Some interesting samples to train on are:

  • Azure ConferenceBuddyAzure ConferenceBuddy

    將回購分叉到您的個人帳戶,克隆回購,打開Conference Buddy.sln解決方案,生成以檢查其工作情況,然後訓練模型。Fork the repo to your personal account, clone the repo, open the ConferenceBuddy.sln solution, build to check that it's working, and then train the model. 您會在 AskWhoTask 類別執行個體上發現一些良好的自動完成。You'll find some good completions on instances of the AskWhoTask class.

  • Windows RSS 閱讀程式Windows RSS reader

    將回購分叉到您的個人帳戶,克隆回購,打開RssReader.sln解決方案,生成以檢查其工作情況,然後訓練模型。Fork the repo to your personal account, clone the repo, open the RssReader.sln solution, build to check that it's working, and then train the model. 您會在 MainViewModel 類別執行個體上發現一些良好的自動完成。You'll find some good completions on instances of the MainViewModel class.

資料和隱私權Data and privacy

要構建團隊模型,我們會提取一個摘要檔,其中包含有關您的類型及其用法的元數據。To build your team model, we extract a summary file with metadata on your types and their usages. 例如,摘要檔包含類和方法的名稱以及它們在不同情況下調用的頻率。For example, the summary file contains the names of classes and methods and how often they're called in different circumstances. IntelliCode 不會追蹤您的按鍵輸入,或從您的程式碼擷取整個運算式、陳述式或常值 (例如字串)。IntelliCode doesn't track your keystrokes or extract whole expressions, statements, or literal values (such as strings) from your code.

擷取的資料會透過 HTTPS 傳輸給 IntelliCode 服務。The extracted data is transmitted, over HTTPS, to the IntelliCode service. 服務接著會使用機器學習演算法,為您的程式碼來定型模型。The service then uses machine learning algorithms to train a model for your code. 它會將模型傳回到您的電腦,並在該處與基本模型合併。It returns the model to your computer where it's merged with the base model.

檢視擷取的資料View extracted data

檢查所擷取資料的內容:To inspect the contents of the extracted data:

  1. 開啟提取的資料目錄:Open the extracted data directory:

    • 對於儲存庫關聯的模型:%溫度%\Intellicode_Extraction_2019-10-23_234524For repository-associated models: %temp%\Intellicode_Extraction_2019-10-23—234524
    • 對使用者關聯的模型 :%TEMP%\視覺工作室 IntelliCodeFor user-associated models: %TEMP%\Visual Studio IntelliCode
  2. 若要尋找並開啟您最近定型工作階段的定型,請依日期 (遞減) 排序資料夾檢視。To find and open the training for your most recent training session, sort the folder view by date (descending). 您最近的定型工作階段資料夾現在位於最上層。The folder for your most recent training session is now at the top.

    提示

    %TEMP%\Visual Studio IntelliCode 目錄中,每個定型工作階段有一個資料夾,各自具有隨機的名稱。There's one folder per training session in the %TEMP%\Visual Studio IntelliCode directory, each with a randomized name.

此資料夾包含擷取完成時傳送給 Microsoft 的完整檔案集合。The folder contains the entire set of files that are sent to Microsoft when extraction is complete. UsageOutput 子資料夾包含一個 JSON 檔案,它具有 IntelliCode 從您程式碼擷取的資訊,以便定型模型。The UsageOutput subfolder contains a JSON file that has the information IntelliCode extracts from your code to train the model. UsageOutput_ErrorStats 檔案包含在嘗試建置所擷取檔案時發現的任何錯誤,並可在 Microsoft 需要偵錯問題時提供協助。The UsageOutput_ErrorStats file contains any errors found when trying to build the extracted file and can help if Microsoft needs to debug issues.

IntelliCode 模型定型目錄IntelliCode model-training directory

如果您想要先檢查不同程式碼基底的擷取資料,然後才在自己的程式碼上試用,請根據公用程式碼基底來定型模型。If you want to inspect the extracted data for a different codebase before trying it on your own code, train a model on a public codebase.

我們如何保護您的資料How we secure your data

您的模型是私有的,那些具有通過選擇 「共用完成」 生成的共用連結的人,以及有權訪問具有關聯模型的存儲庫的人員。Your models are private to you, those people that have the sharing links that you generate by choosing Share completions, and, those who have access to a repository with an associated model.

您與 IntelliCode 服務之間傳送和接收的所有資料會透過 HTTPS 傳輸。All data you send to and receive from the IntelliCode service is transmitted over HTTPS. 您必須登入 Visual Studio才能與服務通訊。You must sign in to Visual Studio in order to communicate with the service. 模型只能由提交提取的數據進行培訓的經過身份驗證的使用者、通過共用模型連結授權的人員以及能夠證明他們有權存取存儲庫的存儲庫的存儲庫的模型進行檢索。Models can only be retrieved either by the authenticated user who submitted the extracted data for training, by someone they authorized by sharing the link to the model, and by users who can prove they have access to the repository for repository-associated models. 這表示,您的模型以及關於您程式碼所學習到內容,會保持由您和您想要的共同作業者所私有。This means that your model and what is learned about your code stays private to you and your intended collaborators.

如果 Microsoft 需要進行疑難排解,則已獲授權的 Microsoft 服務人員只能針對診斷用途獲得您模型和擷取資料的存取權。If Microsoft needs to troubleshoot, authorized Microsoft service personnel may be granted access to your models and extracted data for diagnostic purposes only.

另請參閱See also