paint-brush
100 ngày AI Ngày 3: Tận dụng AI cho Kỹ thuật và suy luận nhanh chóngtừ tác giả@sindamnataraj
2,580 lượt đọc
2,580 lượt đọc

100 ngày AI Ngày 3: Tận dụng AI cho Kỹ thuật và suy luận nhanh chóng

từ tác giả Nataraj5m2024/01/04
Read on Terminal Reader
Read this story w/o Javascript

dài quá đọc không nổi

100 ngày AI Ngày thứ 3, chúng tôi cải tiến các sản phẩm bằng khả năng suy luận, tận dụng LLM để có được thông tin chuyên sâu về công nghệ mà không cần chuyên môn về dữ liệu.

People Mentioned

Mention Thumbnail

Company Mentioned

Mention Thumbnail
featured image - 100 ngày AI Ngày 3: Tận dụng AI cho Kỹ thuật và suy luận nhanh chóng
Nataraj HackerNoon profile picture
0-item

Tôi viết một bản tin có tên Trên mức trung bình, nơi tôi nói về những hiểu biết sâu sắc thứ hai đằng sau mọi thứ đang diễn ra trong ngành công nghệ lớn. Nếu bạn yêu thích công nghệ và không muốn ở mức trung bình, hãy đăng ký theo dõi .


Suy luận về cơ bản là một cách để rút ra những hiểu biết sâu sắc, tình cảm và xu hướng bằng cách sử dụng những lời nhắc thông minh khi tương tác với LLM.


Trước đây, trước LLM, mỗi nhiệm vụ này sẽ yêu cầu mô hình, đào tạo cũng như triển khai và bảo trì riêng. Nhưng với sự bùng nổ của OpenAI và các LLM khác, khả năng suy luận cho phép bạn cải thiện sản phẩm của mình bằng cách tận dụng LLM và bạn không cần phải là nhà khoa học dữ liệu hoặc kỹ sư máy học để làm điều đó.


Ví dụ 1: Giả sử bạn điều hành một trang web thương mại điện tử và muốn trích xuất cảm xúc từ các đánh giá của khách hàng. Bạn có thể thực hiện việc này bằng cách sử dụng dấu nhắc sau. Trong trường hợp này, tôi đang cung cấp văn bản đánh giá và lời nhắc bạn có thể sử dụng trên đó. Bạn có thể sử dụng cách yêu thích của mình để chạy nó với API của Open AI. Tôi đã lấy một bài đánh giá thực tế từ Amazon về hộp đèn mà tôi đã mua để làm ví dụ.

 from openai import OpenAI client = OpenAI() client.api_key = 'YOUR_SECRET_KEY' amazon_review = f""" This softbox lighting system is a great value for the price. They were super easy to set and offer multiple types of lighting, with dimmer and remotes for each light. They are lightweight which means they can topple over if bumped. But that was an easy problem to solve. I just created some weights out of an old pair of socks and some dried beans. You could use rice or sand also. Or just buy sandbags. I like to DIY. Anywho, I highly recommend this lighting system. """ story = """ prompt = f""" Identify the following items from the review text: - Sentiment (positive or negative) - Is the reviewer expressing anger? (true or false) - Item purchased by reviewer - Company that made the item The review is delimited with triple backticks. \ Format your response as a JSON object with \ "Sentiment", "Anger", "Item" and "Brand" as the keys. If the information isn't present, use "unknown" \ as the value. Make your response as short as possible. Format the Anger value as a boolean. Review text: '''{amazon_review}''' """ response = client.chat.completions.create( model="gpt-4", messages=[ { "role": "user", "content": prompt } ], temperature=0, #max_tokens=64, #top_p=1 ) print(response.choices[0].message.content)

Đầu ra tôi nhận được như sau:

{“Tình cảm”: “tích cực”, “Tức giận”: sai, “Mục”: “hệ thống chiếu sáng hộp mềm”, “Thương hiệu”: “không xác định”}


Đây là một ví dụ thú vị cho thấy sức mạnh của việc suy luận bằng API của Open AI. Giờ đây, Amazon là một công ty lớn đã sử dụng AI để cung cấp các tính năng và một trong những cập nhật gần đây của trang này dường như là tóm tắt tất cả các đánh giá về sản phẩm. Đây là cách nó trông cho cùng một sản phẩm.


Bạn có nghĩ rằng nó có thể được tạo lại bằng cách suy luận qua một tập hợp các đánh giá của khách hàng không? Tôi nghĩ vậy. Nếu bạn có thể tìm ra điều này, hãy liên hệ với tôi trên Twitter và cho tôi biết.


Ví dụ 2: giả sử bạn điều hành một trang web tin tức và bạn muốn tìm chủ đề của một bài viết mà không thực sự đọc nó. Bạn có thể làm điều đó bằng cách sử dụng Lời nhắc và suy ra nó không? Vâng, bạn có thể. Đây là một bài viết ví dụ mà từ đó tôi suy ra các chủ đề được đề cập trong bài viết đó.

 from openai import OpenAI client = OpenAI() client.api_key = 'YOUR_SECRET_KEY' article = """ It hasn't been the best start to 2024 for Elon Musk. The owner of X, formerly known as Twitter, appealed to YouTube's biggest star MrBeast to post his videos on the platform, and was promptly rejected. On Dec. 30, 2023, MrBeast, whose real name is Jimmy Donaldson, posted on X to announce his latest video release was available on YouTube: "I uploaded, go watch or I'll drop kick you." Donaldson had uploaded a 20-minute long video to YouTube, in which he chronicled spending a week in solitary confinement. These types of videos, in which Donaldson challenges either himself or an individual with an extreme task, have earned him worldwide notoriety. The social media mastermind earned an estimated $82 million in 2023, and with more than 225 million subscribers on his main channel alone, is the platform's biggest name. After Donaldson posted the appeal to head to YouTube on X, one fan replied: "Upload on this platform too," which is when Elon Musk chimed in with: "Yeah." Musk, the CEO of Tesla and owner of X, has been trying to drum up interest from video viewers since taking over the social media platform in 2022. Schemes have included launching a media partnership with heiress Paris Hilton—which has since been axed—as well as streaming shows from the likes of former Fox star Tucker Carlson. Musk, now with the help of CEO Linda Yaccarino, has also attempted to drum up revenue by launching premium subscription services on the site, which—among other things—allow for users to appear as "verified" and send DMs to other accounts. The moves have been necessary after droves of advertisers left the site over fears their branding would appear beside unregulated content. Musk, a fierce proponent of free speech, has refused to cow to concern from advertisers about how X will prevent their messages from reportedly appearing beside Nazi propaganda, for example. But Musk's attempt to get MrBeast's content on his site—not even exclusively—was rebuffed by the creator. Donaldson replied to Musk directly: "My videos cost millions to make and even if they got a billion views on X it wouldn't fund a fraction of it :/ I'm down though to test stuff once monetization is really cranking!" The polite rebuttal contrasts with the firm interest Donaldson had previously taken in Twitter. Indeed, Donaldson's bio still reads "X Super Official CEO," harking back to the times when speculation was rife about who would take over the day-to-day running of the platform from the ever-busy Musk. """ prompt = f""" Determine five topics that are being discussed in the \ following text, which is delimited by triple backticks. Make each item one or two words long. Format your response as a list of items separated by commas. Text sample: '''{article}''' """ response = client.chat.completions.create( model="gpt-4", messages=[ { "role": "user", "content": prompt } ], temperature=0, #max_tokens=64, #top_p=1 ) print(response.choices[0].message.content)


Đầu ra là:

 Elon Musk, Social Media Platforms, YouTube Content, Advertising Concerns, Monetization Strategies

Khá chính xác phải không?


CẢNH BÁO Ý TƯỞNG SẢN PHẨM AI: Ứng dụng Shopify để tóm tắt và trích xuất thông tin chuyên sâu từ đánh giá của khách hàng. Ứng dụng này sẽ được ra mắt trong cửa hàng ứng dụng Shopify. Tôi sẽ không ngạc nhiên nếu Shopify thực hiện điều này một cách tự nhiên. Chỉ cần sử dụng kỹ thuật nhanh chóng với API AI mở, đây sẽ là một ứng dụng có thể ra mắt sau vài ngày.


Thế là xong ngày thứ 3.

Theo dõi tôi trên Twitter để biết thông tin cập nhật mới nhất về 100 ngày của AI hoặc đánh dấu trang này .


Cũng được xuất bản ở đây .