00:00

Efficient AI Technologies for Freelancers: Course Collaboration between NSU, Fordham University, and Brac Institute

A course collaboration between North South University (NSU) and Fordham University focusing on the use of AI technologies to empower freelancers. The course covers generative AI for modeling, sentiment analysis, emotion recognition, and more. Students explore efficient techniques for leveraging AI in their freelance work, with real-world examples and practical applications.

bibang
Download Presentation

Efficient AI Technologies for Freelancers: Course Collaboration between NSU, Fordham University, and Brac Institute

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Prompt Engineering Generative AI for Modeling Instructor: Mostafa Mushsharat Research Assistant North South University Nabeel Mohammed, PhD Associate Professor ECE, North South University Ruhul Amin, PhD Assistant Professor CIS, Fordham University Instructor: Mohammad Junayed Hasan Research Assistant North South University A Course on Efficient Use of AI Technologies to Facilitate Freelancers. In collaboration with North South University, Dhaka & Fordham University, New York brac institute of governance & development

  2. Generative AI 4 Modeling

  3. Inferring Inference in prompt engineering refers to the process of generating meaningful and contextually appropriate responses from language models. Extracting: ● Labels ● Names ● Quantities ● Sentiment/Emotion

  4. Inferring Sentiment on a Product Review Input Output What is the sentiment of the following product review, which is delimited with triple backticks? The sentiment of the product review is positive. The reviewer expresses satisfaction with the product and the company's customer service. Review text: """ Needed a nice lamp for my bedroom, and this one had additional storage and not too high of a price point. Got it fast. The string to our lamp broke during the transit and the company happily sent over a new one. Came within a few days as well. It was easy to put together. I had a missing part, so I contacted their support and they very quickly got me the missing piece! Lumina seems to me to be a great company that cares about their customers and products!! """

  5. Inferring Sentiment Input Output What is the sentiment of the following product review, which is delimited with triple backticks? positive Give your answer as a single word, either "positive" \ or "negative". Review text: """ Needed a nice lamp for my bedroom, and this one had additional storage and not too high of a price point. Got it fast. The string to our lamp broke during the transit and the company happily sent over a new one. Came within a few days as well. It was easy to put together. I had a missing part, so I contacted their support and they very quickly got me the missing piece! Lumina seems to me to be a great company that cares about their customers and products!! """

  6. Inferring Emotion Input Output Identify a list of emotions that the writer of the following review is expressing. Include no more than five items in the list. Format your answer as a list of lower-case words separated by commas. The emotions expressed in the review are: Review text: """ Needed a nice lamp for my bedroom, and this one had additional storage and not too high of a price point. Got it fast. The string to our lamp broke during the transit and the company happily sent over a new one. Came within a few days as well. It was easy to put together. I had a missing part, so I contacted their support and they very quickly got me the missing piece! Lumina seems to me to be a great company that cares about their customers and products!! """ Satisfaction Appreciation Contentment Positivity Trust 1. 2. 3. 4. 5.

  7. Identifying “Anger” Input Output Is the writer of the following review expressing anger? The review is delimited with triple backticks. Give your answer as either yes or no. No, the writer of the review is not expressing anger. Review text: """ Needed a nice lamp for my bedroom, and this one had additional storage and not too high of a price point. Got it fast. The string to our lamp broke during the transit and the company happily sent over a new one. Came within a few days as well. It was easy to put together. I had a missing part, so I contacted their support and they very quickly got me the missing piece! Lumina seems to me to be a great company that cares about their customers and products!! """

  8. Extract product and company name from customer reviews Input Output Identify the following items from the review text: - Item purchased by reviewer - Company that made the item { "Item": "lamp", "Brand": "Lumina" } The review is delimited with triple backticks. Format your response as a JSON object with "Item" and "Brand" as the keys. If the information isn't present, use "unknown" as the value. Make your response as short as possible. Review text: "" Needed a nice lamp for my bedroom, and this one had additional storage and not too high of a price point. Got it fast. The string to our lamp broke during the transit and the company happily sent over a new one. Came within a few days as well. It was easy to put together. I had a missing part, so I contacted their support and they very quickly got me the missing piece! Lumina seems to me to be a great company that cares about their customers and products!! """

  9. Doing multiple tasks at once Input Output 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 { "Sentiment": "positive", "Anger": false, "Item": "lamp", "Brand": "Lumina" } 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:""Needed a nice lamp for my bedroom, and this one had additional storage and not too high of a price point. …"""

  10. Inferring 5 topics Input Output Determine five topics that are being discussed in the following text, which is delimited by triple backticks. Topics: Make each item one or two words long. Format your response as a list of items separated by commas. Government survey Employee satisfaction NASA Social Security Administration Job satisfaction improvement 1. 2. Text sample: """ In a recent survey conducted by the government, public sector employees were asked to rate their level of satisfaction with the department they work at.The results revealed that NASA was the most popular department with a satisfaction rating of 95%. One NASA employee, John Smith, commented on the findings, stating, "I'm not surprised that NASA came out on top. It's a great place to work with amazing people and incredible opportunities. I'm proud to be a part of such an innovative organization." 3. 4. 5. The results were also welcomed by NASA's management team, with Director Tom Johnson stating, "We are thrilled to hear that our employees are satisfied with their work at NASA.We have a talented and dedicated team who work tirelessly to achieve our goals, and it's fantastic to see that their hard work is paying off." The survey also revealed that the Social Security Administration had the lowest satisfaction rating, with only 45% of employees indicating they were satisfied with their job. The government has pledged to address the concerns raised by employees in the survey and work towards improving job satisfaction across all departments. """

  11. Inferring 5 topics Input Output Determine whether each item in the following list of \ topics is a topic in the text below, which is delimited with triple backticks. Here's a list with 0s and 1s indicating whether each topic is present in the text: Give your answer as list with 0 or 1 for each topic.\ List of topics: "nasa", "local government", "engineering", "employee satisfaction", "federal government" "nasa": 1 "local government": 0 "engineering": 0 "employee satisfaction": 1 "federal government": 1 ● Text sample: """ In a recent survey conducted by the government, public sector employees were asked to rate their level of satisfaction with the department they work at.The results revealed that NASA was the most popular department with a satisfaction rating of 95%. One NASA employee, John Smith, commented on the findings, stating, "I'm not surprised that NASA came out on top. It's a great place to work with amazing people and incredible opportunities. I'm proud to be a part of such an innovative organization." ● ● ● ● The results were also welcomed by NASA's management team, with Director Tom Johnson stating, "We are thrilled to hear that our employees are satisfied with their work at NASA.We have a talented and dedicated team who work tirelessly to achieve our goals, and it's fantastic to see that their hard work is paying off." The survey also revealed that the Social Security Administration had the lowest satisfaction rating, with only 45% of employees indicating they were satisfied with their job. The government has pledged to address the concerns raised by employees in the survey and work towards improving job satisfaction across all departments. """

  12. Zero2Few - Shot Prompting

  13. Zero-Shot Prompting Zero-shot prompting prompting is the most basic form of prompting. ● Input: Add 2+2: It simply shows the model a prompt without examples and asks it to generate a response. ● As such, all of the instruction and role prompts that you have seen so far are zero- shot prompts. ● Output: 4

  14. One-Shot Prompting One-shot prompting is when you show the model a single example. ● Input: Add 3+3: 6 For example, the one-shot analogue of the zero-shot prompt Add 2+2: is: ● Add 2+2: Output: 4

  15. Few-Shot Prompting Few-shot prompting is when you show the model 2 or more examples. ● Input: Add 3+3: 6 Add 5+5: 10 Add 2+2: The few-shot analogue of the above two prompts is: ● Output: 4

  16. More examples

  17. One-Shot Few-Shot -provide single example or instruction -provide more than one example for a specific task -simple tasks -complex tasks -limited input space -higher accuracy needs

  18. Our Goal: To write an email to boss about work update. Prompt: I just launched a new product, the apple car, received 1200 pre orders. Please write an email to my boss with this update.

  19. More Important [Task] [Context] Prompt Format: [Example] [Role] + [Context] + [Task] + [Example] + [Format] + [Tone] [Role] [Format] [Tone] Less Important

  20. [Role] [Context] [Task] [Format] [Example] [Tone] You are a senior product marketing manager at Apple and you have just unveiled the latest Apple Product in collaboration with Tesla, the Apple Car, and received 12,000 pre-orders, which is 200% higher than target. Write an email to your boss. Tim Cookie, sharing this positive news. The email should include a tl:dr (too long, didn't read) section, project background (why this product came into existence), business results section (quantifiable business metrics), and end with a section thanking the product and engineering teams. Use clear and concise language and write in a confident yet friendly tone.

  21. Advanced Techniques

  22. Chain of Thought(CoT) Prompting The main idea of CoT is that by showing the LLM some few shot exemplars where the reasoning process is explained in the exemplars, the LLM will also show the reasoning process when answering the prompt. This explanation of reasoning often leads to more accurate results.

  23. Zero Shot Chain of Thought Zero Shot Chain of Thought (Zero-shot-CoT) prompting1is a follow up to CoT prompting2, which introduces an incredibly simple zero shot prompt. They find that by appending the words "Let's think step by step." to the end of a question, LLMs are able to generate a chain of thought that answers the question. From this chain of thought, they are able to extract more accurate answers.

  24. Standard: Zero Shot CoT:

  25. Self Consistency Self-consistency1is an approach that simply asks a model the same prompt multiple times and takes the majority result as the final answer. It is follow up to CoT, and is more powerful when used in conjunction with it.

  26. Knowledge Generation Single Prompt Approach: Prompt: Generate 4 facts about the Kermode bear, then use these facts to write a short blog post using the information: Output: The Kermode bear, also known as the spirit bear, is a rare subspecies of the American black bear that is found in the coastal regions of British Columbia, Canada. 1. The Kermode bear is a unique subspecies of the American black bear, with approximately 10% of the population having white fur. 2. The Kermode bear is a symbol of the First Nations people of British Columbia, and is seen as a spirit animal. 3. The Kermode bear is an important part of the ecosystem, helping to disperse seeds and maintain the balance of the forest. 4. The Kermode bear is a protected species, and its population is monitored closely by the provincial government. The Kermode bear is a unique and special animal that is found in the coastal regions of British Columbia, Canada. Approximately 10% of the population of this subspecies of the American black bear have white fur, making them a rare sight. The Kermode bear is a symbol of the First Nations people of British Columbia, and is seen as a spirit animal. It is an important part of the ecosystem, helping to disperse seeds and maintain the balance of the forest. The Kermode bear is a protected species, and its population is monitored closely by the provincial government. It is a beautiful and majestic animal, and it is important that we do our part to protect and conserve this species.

  27. Knowledge Generation Prompt: Use the above facts to write a one paragraph blog post about the Kermode bear: Double Prompt Approach: Output: Prompt: Generate 10 facts about the Kermode bear: The Kermode bear, also known as the Spirit Bear, is a rare subspecies of the American black bear found in British Columbia, Canada. This unique bear has a white or cream- colored coat, caused by a recessive gene, and is a symbol of hope and renewal for the First Nations people of British Columbia. The Kermode bear is a protected species and is listed as a species of special concern by the Committee on the Status of Endangered Wildlife in Canada, making it an important part of the region's biodiversity. Output: 1. The Kermode bear, also known as the Spirit Bear, is a rare subspecies of the American black bear found in British Columbia, Canada. 2. The Kermode bear has a unique white or cream-colored coat, which is caused by a recessive gene. 3. The Kermode bear is a symbol of hope and renewal for the First Nations people of British Columbia. 4. The Kermode bear is a protected species and is listed as a species of special concern by the Committee on the Status of Endangered Wildlife in Canada. More control and reliability for longer content.

  28. Least to Most Prompting

  29. Least to Most Prompting Output: Input: CUSTOMER INQUIRY: Thank you for your inquiry. Unfortunately, since you purchased the shirt on March 1st, it is outside of our 30-day return policy. However, we do have a 50% discount on all shirts currently, so you could purchase two shirts with the same amount of store credit. Prices for our shirts range from $18-$100. Please let us know if you have any other questions. I just bought a T-shirt from your Arnold collection on March 1st. I saw that it was on discount, so bought a shirt that was originally $30, and got 40% off. I saw that you have a new discount for shirts at 50%. I'm wondering if I can return the shirt and have enough store credit to buy two of your shirts? INSTRUCTIONS: You are a customer service agent tasked with kindly responding to customer inquiries. Returns are allowed within 30 days. Today's date is March 29th. There is currently a 50% discount on all shirts. Shirt prices range from $18-$100 at your store. Do not make up any information about discount policies.

  30. Least to Most Prompting Output: Input: 1. Determine if the customer is within the 30-day return window. CUSTOMER INQUIRY: I just bought a T-shirt from your Arnold collection on March 1st. I saw that it was on discount, so bought a shirt that was originally $30, and got 40% off. I saw that you have a new discount for shirts at 50%. I'm wondering if I can return the shirt and have enough store credit to buy two of your shirts? 2. Calculate the amount of store credit the customer would receive if they returned the shirt. INSTRUCTIONS: 3. Calculate the cost of two shirts at the current 50% discount. You are a customer service agent tasked with kindly responding to customer inquiries. Returns are allowed within 30 days. Today's date is March 29th. There is currently a 50% discount on all shirts. Shirt prices range from $18-$100 at your store. Do not make up any information about discount policies. 4. Determine if the customer has enough store credit to purchase two shirts. What subproblems must be solved before answering the inquiry?

  31. Least to Most Prompting Output: Input: Yes, the customer is within the 30- day return window. The customer purchased the shirt on March 1st, and today's date is March 29th, which is within the 30-day return window. Therefore, the customer is eligible to return the shirt and receive store credit for the purchase. The customer can use the store credit to purchase two shirts at the current 50% discount. CUSTOMER INQUIRY: I just bought a T-shirt from your Arnold collection on March 1st. I saw that it was on discount, so bought a shirt that was originally $30, and got 40% off. I saw that you have a new discount for shirts at 50%. I'm wondering if I can return the shirt and have enough store credit to buy two of your shirts? INSTRUCTIONS: You are a customer service agent tasked with kindly responding to customer inquiries. Returns are allowed within 30 days. Today's date is March 29th. There is currently a 50% discount on all shirts. Shirt prices range from $18-$100 at your store. Do not make up any information about discount policies. Determine if the customer is within the 30-day return window. Let's go step by step.

  32. Dealing with Long Form Content 1. Preprocessing the Text Before passing the long form content to a language model, it is helpful to preprocess the text to reduce its length and complexity. Some strategies for preprocessing include: Removing unnecessary sections or paragraphs that are not relevant or contribute to the main message. This can help to prioritize the most important content. Summarizing the text by extracting key points or using automatic summarization techniques. This can provide a concise overview of the main ideas. ● ● These preprocessing steps can help to reduce the length of the content and improve the model's ability to understand and generate responses.

  33. Dealing with Long Form Content 2. Chunking and Iterative Approach Instead of providing the entire long form content to the model at once, it can be divided into smaller chunks or sections. These chunks can be processed individually, allowing the model to focus on a specific section at a time. An iterative approach can be adopted to handle long form content. The model can generate responses for each chunk of text, and the generated output can serve as part of the input with the next chunk. This way, the conversation with the language model can progress in a step-by-step manner, effectively managing the length of the conversation.

  34. Dealing with Long Form Content 3. Post-processing and Refining Responses The initial responses generated by the model might be lengthy or contain unnecessary information. It is important to perform post- processing on these responses to refine and condense them. Some post-processing techniques include: Removing redundant or repetitive information. Extracting the most relevant parts of the response. Reorganizing the response to improve clarity and coherence. ● ● ● By refining the responses, the generated content can be made more concise and easier to understand.

  35. Dealing with Long Form Content 4. Utilizing AI assistants with longer context support While some language models have limited context length, there are AI assistants, like OpenAI's GPT-4 and Anthropic's Claude, that support longer conversations. These assistants can handle longer form content more effectively and provide more accurate responses without the need for extensive workarounds. Dealing with long form content can be challenging, but by employing these strategies, you can effectively manage and navigate through the content with the assistance of language models. Remember to experiment, iterate, and refine your approach to determine the most effective strategy for your specific needs.

  36. Emotion prompt

  37. -Emotional stimuli can enrich original prompts’ representation. Especially in EP01, EP03, and EP06∼EP10. -Positive words make more contributions. some positive words play a more important role, such as “confidence”, “sure”, “success” and “achievement”. ● ● -More emotional stimuli generally lead to better performance. adding EP01 to any other group generally improve performance. ● - Combined stimuli can bring little or no benefit when sole stimuli already achieves good performance. The combination EP01 + EP04 gets a high score in most tasks. However, does not improve significantly or even decrease when we add more stimuli, such as EP06∼EP09. ● Combinations from different psychological theories can also boost the performance. e.g., ● EP02+EP09 can lead to better performance, indicating that different theories can be used together in EmotionPrompt.

  38. Hands-On Examples

  39. Extract Topics from a popular Website -summarization -inference Step 1 : Select a website e.g. https://en.wikipedia.org/wiki/2023_Nepal_earthquake Step 2 : Summarize sections into a text file. Step 3 : Extract topics from all text file.

  40. SEO Improvement for a Website -search engine perfect content Step 1. Create a prompt to generate content for similar website using the text file. -content requirements Step 2 : Summarize sections of Google SEO guidelines pdf into another text file. -improving contents -website audit Step 3 : Create a prompt with each section to improve content according to guidelines.

  41. Create A Blog Step 1: Use “Knowledge generation” technique along with other appropriate techniques to create a format for the website content. -outline - fill content - improve content Step 2: Change Format of content from text into HTML. - proofread Step 3 : Edit styles.

  42. Generating Prompts by Prompting You can typically ask instruct models to generate a good prompt for you by specifying small details.

More Related