#๐Ÿ”’ File organizer not working

76 messages ยท Page 1 of 1 (latest)

swift hull
#

I want a Python script that can organize my PDFs. I want it to work like this: Within the main directory, there are several directories. One of them is the input directory that contains the files to be organized. The rest are the categories to which the different input files belong. Each category will contain one or more files that I introduce to mark the category.

For example, I have the category "Mathematics" and I put a PDF of my mathematics notes in it. I have the category "Physics" and I do the same.

The script should read the files and determine which category each one belongs to.

This is the script that ChatGPT gave me:
https://paste.pythondiscord.com/RLFQ

However, all this does is it adds everything to one of the categories. It's not really effective.

slate heathBOT
#

@swift hull

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

swift hull
#

How can I improve it? Are there any already coded scripts that do this?

floral flint
#

You gonna need some ml I think to train them what text classifies as what data

#

Or a simpler approach, seeing as you already used gpt, send the text to the gpt and ask them to which category it fits

green musk
floral flint
#

Yeah we generally don't like gpt code

#

But you can ask gpt to which category the text fit

#

This is the one thing it can be usefull for, but expect errors

swift hull
#

could i make those requests automatics?

floral flint
#

Ofc

#

You'll need a token

swift hull
#

just using the api right

floral flint
#

Yeah basically

swift hull
#

wait whats the limit of requests for the free plan

green musk
#

no limit

floral flint
#

20 per minute

#

I don't think Fitz will keep up, not the gpt

hoary rampart
#

you can definitely try AIs, but they either 1) cost money (if you decide to use an online solution like GPT), or 2) you need a beefy computer to run one locally

swift hull
swift hull
#

isnt there a free plan

green musk
#

i dont have a limit mabey because im not signed in

green musk
swift hull
#

i dont really need it to be gpt 4

floral flint
swift hull
#

yep ofc

floral flint
#

It's just data classification out of categories you give them

hoary rampart
swift hull
#

also gpt 4o is free now

hoary rampart
green musk
floral flint
#

You'll need good prompting though

swift hull
floral flint
#

Or be frisky and just check

if "math" in response
swift hull
#

that might be bad

green musk
#

i was on chatgpt just now

floral flint
#

So lots of prompting that is

swift hull
#

i was also thinking about coding an algorithm using top most used words and stuff like that

floral flint
#

Lmao I like how this evolved from gpt giving broken code to writing own code to ask gpt

green musk
#

bell bouta ring brb

hoary rampart
#

also a personal opinion, but don't just organize them into folders (e.g. Mathematics is 1 folder, Physics is 1 folder)
cause then you might get something like "Calculus Use Cases in Physics" or something and then it sucks

swift hull
#

i actually already coded something that takes the top 100 words that are not standard top used words

#

but its slow and idk

floral flint
swift hull
#

yep thats why

hoary rampart
swift hull
#

whats that

#

thats the rate for the free tier

floral flint
#

Request per minute, request per day, don't know what tpm is, and batch queue is self explanatory

vague jacinth
hoary rampart
swift hull
swift hull
floral flint
#

That's kinda low tbh

hoary rampart
floral flint
#

When you'll test it you'll need to fine tune your prompting
Although

ANSWER IN ONE WORD
which catgoery from the following:
math, English, algebra,...

Does the next text segment fit:

Text

ANSWER IN ONE WORD
swift hull
# floral flint That's kinda low tbh

honestly so what. i can sort 3 files per minute. idc if it takes 1h to sort 180 pdfs i dont have that many plus i can be doing something else in my computer

floral flint
#

Might do the trick lmao

swift hull
floral flint
#

Chat gpt answers better when it's all caps lock

swift hull
swift hull
swift hull
#

oke thank u all guys

floral flint
#

yup, you can split and check for length then decide if its a single word or more

hoary rampart
swift hull
#

yea idk i also have had that problem

#

honestly idk

green musk
#

thanks

slate heathBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.