Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
def
- Page 1
Benchmarking DeepSeek R1 for Text Classification and Summarization
Programming
Computer Science
3 Weeks Ago
by usmanmalik57
… which generates a summary of the news articles. ```python
def
generate_summary(model, system_role, user_query): response = model.chat_completion( messages… each article summary. ```python # Function to calculate ROUGE scores
def
calculate_rouge(reference, candidate): scorer = rouge_scorer.RougeScorer(['rouge1', 'rouge2',…
Text Classification and Summarization with DeepSeek R1 Distill Llama 70B
Programming
Computer Science
1 Week Ago
by usmanmalik57
…```python client = Groq( api_key=userdata.get('GROQ_API_KEY'), )
def
generate_response(system_instructions, user_query): response = client.chat.completions.create( … single summary. ```python # Function to calculate ROUGE scores
def
calculate_rouge(reference, candidate): scorer = rouge_scorer.RougeScorer(['rouge1', '…
Re: Fine-tuning OpenAI Vision Models for Visual Question-Answering
Programming
Computer Science
3 Weeks Ago
by RKE2
Fine-tuning OpenAI Vision Models for visual question-answering is an exciting step forward in AI! It is amazing how these models can combine image recognition with natural language processing to provide accurate, context-aware answers. Cannot wait to see more advancements!
Re: Text Classification and Summarization with DeepSeek R1 Distill Llama 70B
Programming
Computer Science
1 Week Ago
by rproffitt
"Wiz Research Uncovers Exposed DeepSeek Database Leaking Sensitive Information" "Security researchers tested 50 well-known jailbreaks against DeepSeek’s popular new AI chatbot. It didn’t stop a single one." It only seems to get worse the more you look at DeepSeek. And I must note how it is known to not want to talk about …
Re: Text Classification and Summarization with DeepSeek R1 Distill Llama 70B
Programming
Computer Science
1 Week Ago
by policenbicleara
Llama-70B struggles with sentiment analysis (69% accuracy) vs. Qwen-32B (87%). Summarization performance is weaker, with lower ROUGE scores. Qwen-32B is the better choice—smaller, faster, and more accurate.
Evaluating GPT-4o November Model for Text Classification and Summarization
Programming
Computer Science
2 Months Ago
by usmanmalik57
…and text summarization tasks. ```Python # Function to calculate ROUGE scores
def
calculate_rouge(reference, candidate): scorer = rouge_scorer.RougeScorer(['rouge1', 'rouge2', …and returns model accuracy for tweet sentiment classification. ```Python
def
find_sentiment(client, model): tweets_list = dataset["text"].…
Question/Answering over SQL Data Using LangGraph Framework
Programming
Computer Science
2 Months Ago
by usmanmalik57
…4/2321b23724865ceb7058fc4363bd3d9b.png) ```python import pandas as pd import sqlite3
def
csv_to_sqlite(csv_file_path, database_name): try: # Read the CSV file …: Annotated[str, ..., "Syntactically valid SQL query."]
def
convert_question_to_query(state: State): """ Generate SQL query to…
Qwen 2.5-72b Vs. Llama 3.3-70b for Text Classification and Summarization
Programming
Computer Science
2 Months Ago
by usmanmalik57
… which generates a response from the model client. ```python
def
make_prediction(model, system_role, user_query): response = model.chat_completion( messages… the ROUGE scores. ```python # Function to calculate ROUGE scores
def
calculate_rouge(reference, candidate): scorer = rouge_scorer.RougeScorer(['rouge1', 'rouge2',…
Re: Extract Tabular Data from PDF Images using Hugging Face Table Transformer
Programming
Computer Science
2 Months Ago
by mansha99
Awesome
def, plg explain little bit more about this
Programming
Web Development
10 Years Ago
by !@#$
def
y we need this in ruby i am beginner of ruby i donot understand what is use of
def
with out this we make code also i think according to my knowledge it is reserve word
Re: def, plg explain little bit more about this
Programming
Web Development
10 Years Ago
by sepp2k
You need the `
def
` keyword to define methods in Ruby. The reason that you need a keyword for this is that the creator of Ruby decided that was the most convenient syntax for method definitions.
def __init__ problem
Programming
Software Development
14 Years Ago
by ChargrO
…by itself but i want to implement
def
hello and
def
toggle into
def
__init__(self, master=None), at the… would like the code to stay inside the
def
__init__ because i will be adding other functions …this. [CODE] from Tkinter import * class Application(Frame):
def
__init__(self, master=None): self.master = master=None …
Re: def __init__ problem
Programming
Software Development
14 Years Ago
by ChargrO
…out here?? [CODE] from Tkinter import * class Application(Frame):
def
__init__(self, master=None): self.master = master self.menubar =…self) submenu=Menu(menubar,tearoff=0)
def
hello(self): print "hello !"
def
toggle(self): if submenu.entrycget(0,&…
def function(): help
Programming
Software Development
18 Years Ago
by mruane
… my understanding of the area... [code]
def
function(): print '''The user inputs their favourite… a different function is called.''' print prompt_funct1()
def
prompt_funct1(): prompt_f1 = raw_input("What is your… so this goes smoother! ''' except: pass
def
explain(): print '''Can I call function prompt_funct1()'s…
.def Files, dll, Linking Error
Programming
Software Development
13 Years Ago
by JimSim
… getting are similar to the one below: [ICODE]Linking... .\Reports.
def
(4) : warning LNK4017: DESCRIPTION statement not supported for the target… the problem might be with the file Reports.
def
(code below). [CODE]; Reports.
def
: Declares the module parameters for the DLL. LIBRARY…
Re: def function(): help
Programming
Software Development
18 Years Ago
by Zonr_0
… define an input statement inside of a function: [code=python]
def
question(q): #Bassiccly, you are setting the variable 'response' to… a response depending on what the user says: [code=python]
def
question(q): #Bassiccly, you are setting the variable 'response' to…
Re: def function(): help
Programming
Software Development
16 Years Ago
by caribedude
O.k. I understood everything that has gone on here so far, but what I want to know is how to extract a variable from a
def
. For example, if I wanted to use the response variable for something outside the
def
, how would I extract it?
Re: def function(): help
Programming
Software Development
16 Years Ago
by slate
… mean something like that?: [CODE=python] functs=['blue','red','yellow']
def
explain(): print("just type in the function name like… %s"%" or ".join(functs))
def
funct_blue(): print("blue called") while True: inp=raw_input…
Re: .def Files, dll, Linking Error
Programming
Software Development
13 Years Ago
by JimSim
… now solved the problem. The method name given in the .
def
file is the "decorated name" eg: [code]?ReportEventA… version of Visual Studio that I am using, amended the .
def
file accordingly, and it now works! JimSim
Re: def function(): help
Programming
Software Development
18 Years Ago
by mruane
… I tried to accomplish. So basically, if I define that
def
function1() has prompt1 == blue, then prompt1 = blue, not function1()? That…
Re: def function(): help
Programming
Software Development
18 Years Ago
by Mouche
… quite following you. Is this what you mean? [code=python]
def
function1(): prompt1 = "blue" return prompt1 color = function1() # color…
Re: def function(): help
Programming
Software Development
16 Years Ago
by Ene Uran
You use return: [code=python]
def
get_color(): color = raw_input("Enter the name of a color: ") # process it color = color.lower() return color pcolor = get_color() print pcolor [/code]
def f () / loop question
Programming
Software Development
13 Years Ago
by zentechsupport
… script. It is below I am trying to understand the
def
f() how to loop that short code over and over… on here for a while but still dont understand the
def
f(). I saw tons of examples of it used for…
Re: def function not sitting right in code...
Programming
Software Development
13 Years Ago
by bigredaltoid
…, but I am not sure how to approach it. [CODE]
def
percount(line): periods = 0 for char in line: if char… == '.': periods +=1 return periods
def
charcount(line): charnum = 0 for char in line: if char…
def Functions and Variables
Programming
Software Development
14 Years Ago
by KrazyKitsune
How do you use a variable originally from a
def
function?
Re: def Functions and Variables
Programming
Software Development
14 Years Ago
by Enders_Game
one way is to return it e.g. [CODE]
def
func(): variable = 3 return variable x = func() print(x) [/CODE] In this example, you call the function func() it does stuff and returns variable. variable is assigned to x.
def function not sitting right in code...
Programming
Software Development
13 Years Ago
by bigredaltoid
… lines were returning 0 or periods was returning 0. [CODE]
def
percount(myFile): periods = 0 for char in myFile.read(): if…
Re: def function not sitting right in code...
Programming
Software Development
13 Years Ago
by woooee
You should be passing line to the function. [code]
def
percount(line): periods = 0 for char in line: if char == '.': …
Def function confusion
Programming
Software Development
10 Years Ago
by abaddon2031
… code up.Any help would be greatly appriciated thank you.
def
convertToSor(saleDate,Amount,Fname,Lname,Email,Franchise,osg,State,Postal…
Re: Def function confusion
Programming
Software Development
10 Years Ago
by abaddon2031
… for loop and properly indented but still getting the error.
def
convertToSor(saleDate,Amount,Fname,Lname,Email,Franchise,osg,State,Postal…
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC