microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
311 stars 28 forks source link

math formulas are not interpreting visually in Copilot Chat, showing in katex or latex format #978

Open ededovic opened 6 months ago

ededovic commented 6 months ago

When I ask a question of Copilot Chat: write the below as math formula

  # Negative log-likelihood for normal distribution
  nll = -np.sum(-0.5*np.log(2*np.pi*sigma**2) - (y-predicted_y)**2 / (2*sigma**2))

This is the response I get in the vs code:

[ nll = -\sum_{i=1}^{n} \left[ -\frac{1}{2}\log(2\pi\sigma^2) - \frac{(y_i-\hat{y_i})^2}{2\sigma^2} \right] ]

Where:

( n ) is the number of observations.
( \log ) denotes the natural logarithm.
( \pi ) represents the mathematical constant pi.
( \sigma ) is the standard deviation.
( y_i ) represents the actual value for the i-th observation.
( \hat{y_i} ) represents the predicted value for the i-th observation.
The sum is over all ( i ) from 1 to ( n ).

I would be ok with this, notice it is missing i in the \sum as well as some other niceties (I converted the above into notebook markdown by replacing [ ] and ( ) with $ $) :

formula-Screenshot 2024-02-28 211332

Version: 1.87.0 (user setup) Commit: 019f4d1419fbc8219a181fab7892ebccf7ee29a2 Date: 2024-02-27T23:41:44.469Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Windows_NT x64 10.0.22631

howsmadae commented 2 months ago

Is there any work around for the time being? I rely on copilot to quickly check my formulas for my chemistry class.

fremdkoerper commented 1 month ago

Is there any work around for the time being? I rely on copilot to quickly check my formulas for my chemistry class.

I just told it to render the formula again but replace ( [ ] ) with $ and it worked for me

hschmiedhofer commented 1 month ago

Is there any work around for the time being? I rely on copilot to quickly check my formulas for my chemistry class.

I just told it to render the formula again but replace ( [ ] ) with $ and it worked for me

Please elaborate a bit, @fremdkoerper .

I am having no luck with this at all in latest vscode 1.92.o and GitHub Copilot Chat v0.19.2024073102 (pre-release).

This is the best I can get:

image

Problem is, I'd like to use GitHub Copilot for studying Deep Learning, especially since it is now backed by ChatGPT 4. However, without properly rendered formulas it's quite useless.

LinoGoncalves commented 1 month ago

I'm having the same issues with Latex rending in Github copilot, even in the latest release VS Code (1.92) and Github Copilot Chat (Release: 2024-08-02).

Example below:

Prompt: What is the formula for Sample Standard Deviation?

Response: _$$ s = \sqrt{\frac{\sum (x_i - \bar{x})^2}{n - 1}} $$

Where:

$s$ is the sample standard deviation. $xi$ represents each data point in the sample. $\bar{x}$ is the sample mean. $n$ is the number of data points in the sample.

Math notation really needs to display correctly for such as state-of-the-art piece of tech.

sthaber commented 1 month ago

Is there any work around for the time being? I rely on copilot to quickly check my formulas for my chemistry class.

I just told it to render the formula again but replace ( [ ] ) with $ and it worked for me

I've just been pasting it into web based LaTeX renderers. Would be nice if it supported it natively. Clearly the model is trained to think the renderer will work.

spookyahell commented 1 week ago

Bing Chat (copilot.microsoft.com) acting up brought me here.