Viewing a single comment thread. View all comments

alcatrazcgp t1_j2e6gxm wrote

I tried using google assistant, "What are the calories in a ferrero rocher?" gives me an article from 2010 saying its 75 cals, then i ask it "do you have any articles that are more recent?"

and it just gives me an article...about recent articles.

ChatGPT on the other hand gets it, talks to you like a real person and remembers everything you said already, oh and knows CONTEXT. the biggest advantage it has, very impressive tech

306

Lump-of-baryons t1_j2e7xcu wrote

Agreed really powerful at answering basic queries, summarizing facts in an intelligible manner, writing half decent articles, essays, prose and poetry, including code. So tired of the naysayers, this is truly ground breaking tech.

95

savage_slurpie t1_j2e9e2d wrote

It is amazing, but if you have asked it to write any code that has any level of complexity it fails spectacularly.

I see it as a better google search.

42

bortlip t1_j2f16du wrote

That has not been my experience.

If you expect it to give you 100% working code with minimal instruction, it might not work (although it might). But if you work with it just a little bit, it's pretty amazing.

Example: I was reading this article about text summarization with python. The article listed this code:

def summarize(text, per):
    nlp = spacy.load('en_core_web_sm')
    doc= nlp(text)
    tokens=[token.text for token in doc]
    word_frequencies={}
    for word in doc:
        if word.text.lower() not in list(STOP_WORDS):
            if word.text.lower() not in punctuation:
                if word.text not in word_frequencies.keys():
                    word_frequencies[word.text] = 1
                else:
                    word_frequencies[word.text] += 1
    max_frequency=max(word_frequencies.values())
    for word in word_frequencies.keys():
        word_frequencies[word]=word_frequencies[word]/max_frequency
    sentence_tokens= [sent for sent in doc.sents]
    sentence_scores = {}
    for sent in sentence_tokens:
        for word in sent:
            if word.text.lower() in word_frequencies.keys():
                if sent not in sentence_scores.keys():                            
                    sentence_scores[sent]=word_frequencies[word.text.lower()]
                else:
                    sentence_scores[sent]+=word_frequencies[word.text.lower()]
    select_length=int(len(sentence_tokens)*per)
    summary=nlargest(select_length, sentence_scores,key=sentence_scores.get)
    final_summary=[word.text for word in summary]
    summary=''.join(final_summary)
    return summary

I asked chat GPT what it did:

At a high level, this code defines a function that takes in a piece of text and a percentage value, and produces a summary of the text by:

  1. Tokenizing the text and calculating the frequency of each word in the document
  2. Normalizing the word frequencies to the range [0, 1]
  3. Tokenizing the text into sentences and calculating a score for each sentence based on the normalized word frequencies of the words it contains
  4. Selecting the highest-scoring sentences based on the specified percentage of the total number of sentences
  5. Returning the selected sentences as a single summary string

I then asked it to write that same code as c# and it gave me the (nearly: I had to add one cast) perfect LINQ:

            var words = Regex.Split(text, @"\s+")
                .Where(x => !stopWords.IsStopWord(x.ToLower()) && !char.IsPunctuation(x[0]))
                .GroupBy(x => x) 
                .ToDictionary(g => g.Key, g => (double)g.Count());

            var maxCount = words.Max(x => x.Value);
            words = words.ToDictionary(x => x.Key, x => (double)x.Value / maxCount);

            var sentences = Regex.Split(text, @"(?<=[\.!\?])\s+")
                .Select(x => x.Trim())
                .ToArray();

            var scores = sentences
                .Select(x => x.Split(' ')
                    .Select(y => words.ContainsKey(y) ? words[y] : 0)
                    .Sum())
                .ToArray();

            var summary = string.Join(" ", sentences
                .Zip(scores, (s, c) => new { Sentence = s, Score = c })
                .OrderByDescending(x => x.Score)
                .Take((int)(per * sentences.Length))
                .Select(x => x.Sentence));

That's a pretty high level of complexity to me.

32

Lump-of-baryons t1_j2eamgc wrote

I’ve been using it to teach myself basic coding for Excel Macros, yeah nothing fancy but it gave me enough of a ground level understanding to get started super fast.

Overall I think peoples expectations are too high right now. Let’s see what GPT4 does next year.

Where it really shines is having it write something “in the style of x”. Have x be a famous author, historical figure, Homeric style, Shakespearean English, etc. Really interesting results if one plays with it a bit.

27

whitewateractual t1_j2ecxpy wrote

I, over a series of prompts, had it compose an absurdly detailed story about a squirrel civil war. And then I asked it to convert the entire story into a series of 50 haikus. It was wild.

39

ksoss1 t1_j2ffu1c wrote

Also want to get into Excel Macros. I'll definitely use ChatGTP to get started.

3

SkylorBeck t1_j2eafqb wrote

I can't believe how many people are trying to use a chat bot to write code and expect it to work. Use a code bot.

23

bortlip t1_j2f1ech wrote

I've actually had better success getting good code out of chat GPT than I have out of the code specific models available on openai's playground.

I'm curious what code bots your are using.

16

mrpoops t1_j2f5f5j wrote

Yup, same here. It also documents it in chatgpt but not in the playground.

The trick, as always, is to modularize. Don’t ask chatgpt for an entire application. Outline the code yourself first. Figure out your data structures/custom objects. Then figure out the functions required to do the work in the application, and how those functions will pass around your objects.

Only after you understand the flow…THEN have chatgpt write all the individual functions. You should know how you want your program to work and what the data looks like anyway. So map it out then have chatgpt do only the tedious programming parts.

5

bortlip t1_j2f75co wrote

Agreed. I also can advance pretty quickly by going back in forth with it. It's like a junior developer that I just dictate to and correct here and there and it does all the typing and puts things together intelligently.

3

SkylorBeck t1_j2f94w2 wrote

Github Copilot. Even just saying it I can feel the comments starting now.

"I tried it for a day. It just makes boilerplate. Not impressed"

It's saved me dozens of hours since I started using it last year.

5

bortlip t1_j2f9oev wrote

No, I'm not looking to start an argument with you, that was a legitimate question.

I'm played with chatGPT and the models in the playground so far. I intend to start playing with copilot soon, but haven't tried it yet.
I really like the ability to go back and forth with the chat aspect and have the AI build the code that way and I am curious how the tab complete will compare to that experience.

3

SkylorBeck t1_j2fa6k0 wrote

I wasn't meaning you, but reddit really has a hate boner for Copilot and anyone who uses it.

The communication aspect is definitely lacking but you can use comments in your code to influence the suggestion. And you can also view alternative suggestions at the same time. Sometimes you need to clarify, or start one line with how exactly you want to go about things. Sometimes I just name the method and it autocompletes it based on the class name and method name. Sometimes it suggests new fields or alternative ways to do something and I change my methods to suit it.

Sometimes it's really hard to tell where the AI started writing and where I stopped. Really does feel like a copilot. I'd estimate anywhere from 40-60% of any given chunk of my code is AI written.

​

Edit for context: I make Minecraft Mods, Unity Games and Java based automation tools.

2

EternalNY1 t1_j2fknkc wrote

My point exactly. There are so many examples of it "failing" to write complex code yet the thing can explain quantum mechanics to you in the form of Shakespere.

And it still does a pretty amazing job with code!

1

SIGMA920 t1_j2exnez wrote

> I see it as a better google search.

Except it's not even that. It's a slightly smarter chatbot, google finds links you can use.

2

EternalNY1 t1_j2fkdrq wrote

It is extremely impressive at translating code between languages, code it has never seen before. And obviously that is not data that has been scraped from a web page.

However, a lot of people point out it doesn't write complex code that well. The thing is, it's not advertised as a tool to help out software engineers. The fact that it can actually write code as well as it does I find impressive enough.

1

unorigionalscreename t1_j2f6xb0 wrote

I had a conversation with it about Michele Foucault, his core philosophies and how he might respond to my criticisms. I have no idea how accurate it was, but very impressive that it could hold that level of conversation and provide contextual responses.

2

creakyclimber t1_j2fnil1 wrote

But did it tell you WHERE to buy Ferrero Rocher and start “reminding” you with ads about chocolate? ChatGPT has a long way to go when it comes to selling you things you don’t want!

22