WitteShadovv
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Lecture Helper This is a group project by Dante Suwanda and Janosch Bühler. <!-- <img src="https://i.imgur.com/a2uDDCs.png" style="zoom: 67%;" /> --> [[_TOC_]] --- ## Inspiration When we first started exploring ideas, we thought of reworking the project we did in AIFo, our AoE2-helper. It might have been a good idea, but we soon found out that OpenAI would be able to do those things with ease. But then we asked ourselves how many of our fellow students would really use this? We tried to be totally honest with ourselves and came to the conclusion that it would only be a few persons at most. So then we thought, what could be useful for students? And thus the idea for lecture helper was born: A service which takes questions, corrects them (grammatically), answers them and returns a Markdown file. It does a bunch of other cool stuff now, but we didn't think of that at the beginning and the ideas came gradually. <div style="page-break-after: always;"></div> ## OpenAI ### What is OpenAI? OpenAI is a company that researches and develops AI. The name is also often used for the newest AI they developed, which is currently GPT-3. In our project we used GPT-3. OpenAI GPT-3 is a machine learning platform that can be used to train and deploy artificial intelligence models. It is also capable of natural language processing and can be used to generate text, translate languages, and understand and respond to questions. ### Getting started OpenAI GPT-3 is very easy to get started with. All you need is a text editor and a web browser and you can start with using the services they offer. You can find all the necessary documentation and resources on the [OpenAI website](https://beta.openai.com/docs/introduction). You need to register there and after that you can use your API key to communicate with the AI via the API. There are also some really good [examples](https://beta.openai.com/examples) to get you started. Thats also how we started to work on our little project with OpenAI. We just began to import the OpenAI into our IDE and played around with it and test its boundaries. ### Cost for commercial use OpenAI GPT-3 is basically free for non-commercial use. For commercial use, pricing starts at \$10 per hour. You also have to consider that you have prices per use which apply to non-commercial and commercial use. Those start at \$0.10 per token and \$0.01 per API request. As a non-commercial user you get 18$ for free. Tokens are "pieces of words", 1000 tokens average about 750 words. > For the base models the following prices apply. ![](https://i.imgur.com/KrPCUCO.png) We use Davinci for our project and the cost is therefore 0.06$/1k tokens. ### Market You can use the services OpenAI offers for various things. Some might be niche but others could potentially get used by the whole world. Our lecture helper could potentially be of use for millions of students worldwide. Open AI is a really powerful tool which, in combination with enough resouces, can basically learn and therefore automate almost everything. <!-- ### Include a code snippet only if it demonstrates something interesting (e.g. only two lines of code to solve this or that) ###Anything else you find worth mentioning. --> <div style="page-break-after: always;"></div> ## Lecture Helper <!-- Rework titles, only for now to structure report --> <!-- Include small intro here --> ### Specs The backend of our tool is written in Python and the generation of the Markdown is done using Jinja. We plan to create a frontend, but the technologies we want to use for that aren't fixed yet. > We created a simple workflow to better understand how it works exactly <center> ![](https://i.imgur.com/GhmzfgC.png) </center> ### What it can do Our tool is great at giving answers to questions which have a definitive answer. It will then create a markdown file with the evaluated topic of the questions as the title, all the questions with their answers, and a quick summary. It also generates a table of contents and an inspirational quote which suits the topic of the questions. The inspirational quote is in a colored box, and the color of the box is a color that the AI regards as suiting for the topic. ### What it can't do The AI is bad at giving answers to non-scientific questions. It will try to avoid answering those questions most of the time or give a vague answer. To get a useful answer, you need to pressure the AI into giving it by including things like *'Answer the question and don't avoid it.'* We expected this and it isn't a problem for us. Our lectures are scientific and the quality of the answers to our questions is quite good. If you ask theological questions the quality of the answers is interesting and quite amusing. We don't regard this as a problem because we don't think that you should ask an AI those questions anyway. ### Challenges We tried to keep the count of API requests per generated PDF low to be able to generate it faster and to keep the costs down. We came to the conclusion that it would be a good idea to send all the questions in one request. This also had the advantage that the AI could evaluate the connections and the topic of the questions way better. But it was really hard to convince the AI to give us separate answers to each question and not merge all the answers together. We found out that the best way to achieve that was to give it short and simple sentences as instructions on what it had to do with the next lines. If the instructions were long sentences or complicated, it ignored some of the instructions. We also narrowed the input down by pre-defining some instructions like that the answer should be "a simplified and scientic answer". Because the AI is input reliant and sensitive, pre-defining some instructions is very important, so that the user can ask short questions or give little input, but gets a usable answer for the lecture. ### Wordsmithing To some questions the AI returns, for human understanding, random and out of context answers. Therefore we tried to mitigate this problem by manually appending predefining sentences to each user input. Below are some interesting API query examples. Because our lecture helper is for students who are interested in fact-based knowledge, we defined each request as a question that requires scientific answer: ```python= response_scientific_definition = query_openai("I need a simple definition for each line of the text that starts below. Separate your answers by ###: \n\n" + joined_notes) ``` --- The following statement also corrects the user input which is also displayed in our final notes. This is a nice and easy way to guarantee the grammatical correctness of our returned markdown file and will simultaneously have a nice learning effect on it's user. ```python= response_question = query_openai("Correct these sentences to standard English and separate your answers with a ###: \n\n" +joined_notes) ``` --- It was quite hard to stop the enthusiasm of the AI when picking a CSS color code. Sometimes it explained why it picked the color, sometimes it returned multiple color codes and sometimes it didn't return a color code but returned a made up color. We would have been able to fix this by using something like regex but doing this only with the AI was a fun challenge. ```python= response_color = query_openai("A CSS color code that matches the keywords below. The CSS code should be bright and suited for black text. Answer only with the CSS code: \n\n" + str(output['keywords'])) ``` ### Example You can view an example in the [appendix](#Example-Output) ### Current status Our tool is already usable and works well. You do, however, have to submit your questions either via a commandline interface or as a CSV file. Sometimes (about 5% of the time) the format in which the AI replies is weird, and we still need a way to fix that or minimize it even further. But in general it works astonishingly well and already had it's use cases for our lectures. <div style="page-break-after: always;"></div> ### Possibilites of Lecture Helper You could fine-tune the OpenAI GPT-3 Model by submitting PDFs on your own. You could do that by submitting the PDFs of the course you are currently visiting. Those PDFs would be perfect because they include the things you need to know for the exam. Sometimes there are multiple definitions of the same thing and right now the AI could get that wrong because it simply doesn't know which definition we are using. ## Conclusion This project was a lot of fun and taught us much about OpenAI. We noticed that it is not hard at all to start working with such a powerful tool and implementing it in to a little project like lecture helper, but we can only imagine how hard it must be to master that kind of technology, for example to go as far as putting human lives into an AI-controlled vehicle, this would take much more experience, precision and resources.We would absolutely love to use a tool like OpenAI GPT-3 in a bigger project. We had a lot of fun experimenting and testing the AI. It was really interesting to see how far the technology of text-based AIs has come, how well they work and how easy it is to implement them into your projects. It was a lot of fun to think of other possible projects that we could do with it, because the possibilities of AI are limitless and you can get really creative with them. And we still didn't fully let go of the idea to improve our aoe2-helper which we made in AIFo so we might do that in the future. <!-- ### What are your conclusions? Ask yourself: would you like to use the tool in a semester or bachelor project? Describe what kind of project idea that would be? --> --- <!-- <div style="page-break-after: always;"></div> --> # Appendix ## Jinja Template > Our Jinja template is simple but includes everything we need quite elegantly. We had to include some CSS styling for the inspirational quote which is supported by Markdown. ```javascript= # {{ values.topic }} <div style="background-color: {{ values.color }};border-radius: 10px;"> {{ values.inspirational_quote }} </div> [[_TOC_]] ## Notes {% for entry in values.entries %} ### {{ entry.keyword }} > {{ entry.question }} {{ entry.response }} {% endfor %} ## Summary {{ values.summary }} ``` ## Example Output This is a real life example of notes we took with lecture helper during our CN2 lecture: >In the screenshot below you can see a snipped of the postman request that our lecture helper makes to OpenAI <center> ![](https://i.imgur.com/RYDPZbN.png) <div style="page-break-after: always;"></div> </center> >And the following markdown file is the output that our lecture helper returns to the user: <center> ![](https://i.imgur.com/fWp0H5Z.png) <div style="page-break-after: always;"></div> ![](https://i.imgur.com/HWNa8uK.png) </center>

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully