Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
len
- Page 1
Question Answering with YouTube Videos Using RAG in LangChain
Programming
Computer Science
3 Weeks Ago
by usmanmalik57
…"Total number of videos: {
len
(docs)}") print("=====================================")…``` ``` text_splitter = RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=200, length_function=
len
, ) text_splitter = RecursiveCharacterTextSplitter() documents = text_splitter.split_documents(docs) ```…
Retrieval Augmented Generation with Hugging Face Models in LangChain
Programming
Computer Science
2 Weeks Ago
by usmanmalik57
…splitter = RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=200, length_function=
len
) all_text_chunks = [] # To store chunks from … all_text_chunks.extend(text_chunks) print("Total chunks:",
len
(all_text_chunks)) print("============================") ``` **Output:** ``` …
Summarizing YouTube Video Transcriptions Using Distil Whisper and LLM
Programming
Computer Science
1 Week Ago
by usmanmalik57
…, 0.1) print(f"Total characters in summarized result: {
len
(response)}") print(response) ``` **Output:** ![Image_2](https://static.daniweb.com…
Re: Extract Tabular Data from PDF Images using Hugging Face Table Transformer
Programming
Computer Science
1 Week Ago
by Harini sri
Hi, Thank you so much for the above code. Its giving better results compared to other libraries. I have few questions. In some tables, I have common column name for three columns and further I have sub columns like below.... in these cases the tables are not getting extracted properly...Do you have any suggestions for handling such cases? Also …
Extract Tabular Data from PDF Images using Hugging Face Table Transformer
Programming
Computer Science
2 Months Ago
by usmanmalik57
…to cell_coordinates cell_coordinates.append({'cells': row_cells, 'cell_count':
len
(row_cells)}) return cell_coordinates cell_coordinates = get_cell_coordinates_by_row(features) ```…row_text.append(text) if
len
(row_text) > max_num_columns: max_num_columns =
len
(row_text) data[idx] =…
Retrieval Augmented Generation (RAG) with Google Gemma From HuggingFace
Programming
Computer Science
2 Months Ago
by usmanmalik57
…= RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=200, length_function=
len
) ``` The script below divides all the …) all_text_chunks.extend(text_chunks) print("Total chunks:",
len
(all_text_chunks)) print("============================") ``` **Output:** ``` Total…
Claude 3 Opus Vs. Google Gemini Vs. GPT-4 for Zero-Shot Text Classification
Programming
Computer Science
1 Month Ago
by usmanmalik57
…quot;].tolist() i = 0 exceptions = 0 while i <
len
(tweets_list): try: tweet = tweets_list[i] sentiment_value = find_sentiment_gemini(tweet)…quot;].tolist() i = 0 exceptions = 0 while i <
len
(tweets_list): try: tweet = tweets_list[i] sentiment_value = find_sentiment_claude(tweet)…
7 NLP Tasks to Perform for Free in Python with Mistral 7b LLM
Programming
Computer Science
1 Month Ago
by usmanmalik57
…;"" print(f"Total characters in original paragraph: {
len
(paragraph)}") input_text = f"Summarize the following text: {paragraph…, 0.9) print(f"Total characters in summarized paragraph: {
len
(response)}") print(response) ``` **Output:** ![image2.png](https://static.daniweb…
Fine Tuning Google Gemma Model for Text Classification in Python
Programming
Computer Science
2 Months Ago
by usmanmalik57
… `negative`, which we discard. ``` targets = [] predictions = [] for i in range(
len
(final_dataset['test'])): review = final_dataset['test'][i]['review'] target_sentiment = final_dataset['test…
Re: How can I upload a tar.bz2 file to openstack swift object storage container
Programming
Software Development
1 Month Ago
by Salem
…') >>> bytes = gz.read() >>> print(
len
(bytes)) 10240 >>> print(str(bytes)[:80]) b…') >>> rawbytes = rawfile.read() >>> print(
len
(rawbytes)) 181 In other words, treat every single file the…
len function in c sharp
Programming
Software Development
15 Years Ago
by dc_24l
what is the equivalent function of
len
in vb6 in c #? example is: VB: string s; s =
len
(txt1.text) what is
len
's equivalent function in csharp?
Re: len function in c sharp
Programming
Software Development
15 Years Ago
by selvaganapathy
Hi In C#, string.Length property returns the length of the string similar to
Len
() function in vb. [CODE=C#] int iLength; string s = "C# Programming"; iLength = s.Length; [/CODE]
len( ) of two set( ) lists
Programming
Software Development
13 Years Ago
by bpatt22
What are some alternatives to writing [CODE]
len
(mylist3 & mylist4)[/CODE] within this code? [CODE] mylist1 = [1,2,3] mylist2 = [4,5,6] mylist3 = set(mylist1) mylist4 = set(mylist2) lenresult =
len
(mylist3 & mylist4) [/CODE] A module i'm importing is unable to use the count() that gets called with the ' & ' operator.
Re: len( ) of two set( ) lists
Programming
Software Development
13 Years Ago
by vegaseat
[code]mylist1 = [1,2,3,4] mylist2 = [3,4,5,6] myset1 = set(mylist1) myset2 = set(mylist2) # intersection of sets myset1 and myset2 # gives a new set containing the common elements myset3 = myset1.intersection(myset2) print(myset3) # set([3, 4]) print(
len
(myset3)) # 2 [/code]
Re: problem on len()
Programming
Software Development
17 Years Ago
by a1eio
…program? Check to see if you are using '
len
' as a variable in your program, because thats…,2:2,3:3,4:4} print
len
(dic) def main(): print
len
(dic)
len
=
len
(dic) if __name__ == '__main__': main()…", line 6, in main print
len
(dic) UnboundLocalError: local variable '
len
' referenced before assignment [/QUOTE] Tis a…
strings as input, substr and len
Programming
Software Development
19 Years Ago
by rborob
…/pseudocode [code] entil EOF do; string = input;
len
= length(string); for i=1 to
len
do ch = substr(string, i-1, 1…
Re: strings as input, substr and len
Programming
Software Development
19 Years Ago
by Dave Sinkula
…(file, input) ) { for ( std::string::size_type i = 0,
len
= input.size(); i <
len
; ++i ) { switch ( input[i] ) { case '0': std::cout…
problem on len()
Programming
Software Development
17 Years Ago
by katharnakh
I have a dictionary defined say D, I also have initialized it. When I say
len
(D), some time it gives me correct answer, but some times it throws me error saying [I]UnboundLocalError: local variable '
len
' referenced before assignment[/I] can anybody tell me why is this error. Am I wrong some where. Thank you, kath.
Re: query len of string... POSSIBLE ?
Programming
Software Development
15 Years Ago
by selvaganapathy
Hi, You can get the Length of String using
Len
Function. For ex [CODE] Dim TransID as String Dim LengthOfTID as Integerr TransID = "RMI-000000" LengthOfTID =
Len
( TransID ) If LengthOfTID = 10 Then 'MSAccess ElseIf LengthOfTID = 11 Then 'MSSQL End If [/CODE] I hope it may help you.
Re: Assigning len() to a variable
Programming
Software Development
10 Years Ago
by CodingCabbage
or data = str(input("Please enter a 64 letters string: ")) if (
len
(data) <= 64) and (
len
(data) > 0): print("SUCCESS") else: print("FAILURE")
Re: Assigning len() to a variable
Programming
Software Development
10 Years Ago
by TrustyTony
> and
len
(data) > 0 Only way
len
not to fulfill this condition is data to be empty value, which is False value in Python, so the condition could be and data
query len of string... POSSIBLE ?
Programming
Software Development
15 Years Ago
by jaasaria
sir, question.. can i get the exact
len
of string when quering? because i have two format in …
Re: query len of string... POSSIBLE ?
Programming
Software Development
15 Years Ago
by jaasaria
… ''''...my "ID" is autoincremented while not .eof if
len
(!field) = 10 then str = !field end if wend str = str…
Assigning len() to a variable
Programming
Software Development
10 Years Ago
by Jacklittle01
I'm writing a program that is going to be used for encryption. It can only encrypt 64 letters at a time. How can I make a check for that using
len
()?
Re: Assigning len() to a variable
Programming
Software Development
10 Years Ago
by Gribouillis
Your question is very opaque. I suspect it is already encrypted. Nevertheless, try this: try: input = raw_input except NameError: pass data = input("Please enter a 64 letters string: ") if
len
(data) == 64: print("SUCCESS") else: print("FAILURE")
Re: Assigning len() to a variable
Programming
Software Development
10 Years Ago
by vegaseat
Hint ... # this test string will have 65 characters s = 'q' * 65 length =
len
(s) if length <= 64: encrypted = encrypt(s) else: print("string exceeds 64 characters")
not using len() to get length
Programming
Software Development
9 Years Ago
by ram_10
… string. And I can't use the built in function
len
(). I tried the code below and I can't figure…
Re: len function in c sharp
Programming
Software Development
15 Years Ago
by Jx_Man
[code=C#]string s; s = textBox1.Text.Length.ToString();[/code]
Re: len function in c sharp
Programming
Software Development
15 Years Ago
by vinaya
string strlen; strlen=txtstr.txt.Length.tostring(); // if u r directly taking from the textbox control. string strlen; strlen=somestring.Length;// in general
Re: len( ) of two set( ) lists
Programming
Software Development
13 Years Ago
by bpatt22
perfect, thx
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
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
© 2024 DaniWeb® LLC